src/Helpers/Form.php
public function generateSelectField($attr)
    {
        if (empty($attr['name'])) {
            return '';
        }

        $options = array();

        if (! empty($attr['options'])) {
            $options = $attr['options'];
        }
        $options = $this->generateSelectOptions($options, $attr);

        unset($attr['options'], $attr['type'], $attr['selected']);

        return $this->Html->tag('select', $attr, $options, true);
    }
public function generateSelectField($attr)
    {
        if (empty($attr['name'])) {
            return '';
        }

        $options = array();

        if (! empty($attr['options'])) {
            $options = $attr['options'];
        }
        $options = $this->generateSelectOptions($options, $attr);

        unset($attr['options'], $attr['type'], $attr['selected']);

        return $this->Html->tag('select', $attr, $options, true);
    }
public function generateSelectField ( $ attr ) { if ( empty ( $ attr [ 'name' ] ) ) { return '' ; } $ options = array ( ) ; if ( ! empty ( $ attr [ 'options' ] ) ) { $ options = $ attr [ 'options' ] ; } $ options = $ this -> generateSelectOptions ( $ options , $ attr ) ; unset ( $ attr [ 'options' ] , $ attr [ 'type' ] , $ attr [ 'selected' ] ) ; return $ this -> Html -> tag ( 'select' , $ attr , $ options , true ) ; }
generate a select field

@param   array   array of attributes
@return  string
generate a select field