phpformszend-frameworkucfirst

how to uppercase only first in zend form inputs?


I am working with Zend Form, and on the edit i want the values to be like ucfirst(values) ;. I found filters 'filters' => array('StringToUpper') but they work on the hole input. Any idea ? Thanks


Solution

  • No such filter exists but it would be trivial to create your own:

     class My_Filter_StringUCFirst implements Zend_Filter_Interface {
         public function filter($value){
             return ucfirst($value);
         }
     }