#6301: Change default behavior of FormHelper.input to call the type method (if 
type method exists)
    Reporter:  captainego  |          Type:  Enhancement
      Status:  new         |      Priority:  Low        
   Milestone:  1.3.x.x     |     Component:  Helpers    
     Version:  1.2 Final   |      Severity:  Minor      
    Keywords:  FormHelper  |   Php_version:  PHP 5      
Cake_version:  |  
 I have been working on some form extensions (making pretty inputs for
 social security numbers, phone numbers, zip codes, etc).  Currently I have
 to reimplement the input function in order to get my pretty inputs to have
 the same behaviors as the Form Helper.
 If the Form Helper were to call $this->{type} as the default behavior then
 classes that extend FormHelper would not have to reimplement inputs.
 These classes could just implement the new type function, and pass the
 type to the standard input call to generate all of the wrappings.  This
 change maintains the current default behavior for cases where the type
 method does not exist.
 The code change would be:
 From FormHelper input (line 797):

 case 'textarea':
         $out = $before . $out . $between . $this->textarea($fieldName,
                 array('cols' => '30', 'rows' => '6'), $options
         if (method_exists($this, $type)) {
                 $out = $before . $out . $between .
 $this->{$type}($fieldName, $options);
         } else {
                 $out = $before . $out . $between .
 $this->textarea($fieldName, array_merge(
                         array('cols' => '30', 'rows' => '6'), $options

Ticket URL: <https://trac.cakephp.org/ticket/6301>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to