original_string: public function generateField($name, $attr = array())
      {
          $tag = 'input';
  
          if (in_array($attr['type'], $this->customGenerate)) {
              $tag = $attr['type'];
          }
          $attr['name'] = $this->transformName($name);
  
          $attr = $this->getData($name, $attr);
  
          if ($tag !== 'input') {
              $generate = 'generate' . ucfirst(strtolower($tag)) . 'Field';
              return $this->{$generate}($attr);
          } else {
              return $this->Html->tag('input', $attr);
          }
      }
code: public function generateField($name, $attr = array())
      {
          $tag = 'input';
  
          if (in_array($attr['type'], $this->customGenerate)) {
              $tag = $attr['type'];
          }
          $attr['name'] = $this->transformName($name);
  
          $attr = $this->getData($name, $attr);
  
          if ($tag !== 'input') {
              $generate = 'generate' . ucfirst(strtolower($tag)) . 'Field';
              return $this->{$generate}($attr);
          } else {
              return $this->Html->tag('input', $attr);
          }
      }
code_tokens: public function generateField ( $ name , $ attr = array ( ) ) { $ tag = 'input' ; if ( in_array ( $ attr [ 'type' ] , $ this -> customGenerate ) ) { $ tag = $ attr [ 'type' ] ; } $ attr [ 'name' ] = $ this -> transformName ( $ name ) ; $ attr = $ this -> getData ( $ name , $ attr ) ; if ( $ tag !== 'input' ) { $ generate = 'generate' . ucfirst ( strtolower ( $ tag ) ) . 'Field' ; return $ this -> { $ generate } ( $ attr ) ; } else { return $ this -> Html -> tag ( 'input' , $ attr ) ; } }
docstring: generate a field
  
  @param   string  The type of input field to create
  @param   array   Array of attributes for the tag
  @return  string
docstring_tokens: generate a field