public function select($name, $options = null, $attributes = array())
    {
        $attributes['name'] = $name;

        if (!isset($attributes['id'])) {
            $attributes['id'] = str_replace(array('[', ']'), array('_', ''), $name);
        }

        if (is_array($options)) {
            $options = array_merge(array('options' => array(), 'selected' => null), $options);
            $options = $this->options($options['options'], @$options['selected']);
        }

        return $this->tag('select', (string) $options, $attributes);
    }
public function select($name, $options = null, $attributes = array())
    {
        $attributes['name'] = $name;

        if (!isset($attributes['id'])) {
            $attributes['id'] = str_replace(array('[', ']'), array('_', ''), $name);
        }

        if (is_array($options)) {
            $options = array_merge(array('options' => array(), 'selected' => null), $options);
            $options = $this->options($options['options'], @$options['selected']);
        }

        return $this->tag('select', (string) $options, $attributes);
    }
public function select ( $ name , $ options = null , $ attributes = array ( ) ) { $ attributes [ 'name' ] = $ name ; if ( ! isset ( $ attributes [ 'id' ] ) ) { $ attributes [ 'id' ] = str_replace ( array ( '[' , ']' ) , array ( '_' , '' ) , $ name ) ; } if ( is_array ( $ options ) ) { $ options = array_merge ( array ( 'options' => array ( ) , 'selected' => null ) , $ options ) ; $ options = $ this -> options ( $ options [ 'options' ] , @ $ options [ 'selected' ] ) ; } return $ this -> tag ( 'select' , ( string ) $ options , $ attributes ) ; }
Create a select tag.

@param $name string
@param $selectedOption string|array
@param $attributes array

@return LibBaseTemplateHelperHtmlElement
Create a select tag .