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);
        }
    }
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);
        }
    }
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 ) ; } }
generate a field

@param   string  The type of input field to create
@param   array   Array of attributes for the tag
@return  string
generate a field