Form.php
public static function select($name, array $options = null, $selected = null, array $attributes = null)
    {
        // Set the input name
        $attributes['name'] = $name;

        // Set the input id
        $attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;

        $options_output = '';

        foreach ($options as $value => $name) {
            if ($selected == $value) $current = ' selected '; else $current = '';
            $options_output .= '<option value="'.$value.'" '.$current.'>'.$name.'</option>';
        }

        return '<select'.Html::attributes($attributes).'>'.$options_output.'</select>';
    }
public static function select($name, array $options = null, $selected = null, array $attributes = null)
    {
        // Set the input name
        $attributes['name'] = $name;

        // Set the input id
        $attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;

        $options_output = '';

        foreach ($options as $value => $name) {
            if ($selected == $value) $current = ' selected '; else $current = '';
            $options_output .= '<option value="'.$value.'" '.$current.'>'.$name.'</option>';
        }

        return '<select'.Html::attributes($attributes).'>'.$options_output.'</select>';
    }
public static function select ( $ name , array $ options = null , $ selected = null , array $ attributes = null ) { // Set the input name $ attributes [ 'name' ] = $ name ; // Set the input id $ attributes [ 'id' ] = ( isset ( $ attributes [ 'id' ] ) ) ? $ attributes [ 'id' ] : $ name ; $ options_output = '' ; foreach ( $ options as $ value => $ name ) { if ( $ selected == $ value ) $ current = ' selected ' ; else $ current = '' ; $ options_output .= '<option value="' . $ value . '" ' . $ current . '>' . $ name . '</option>' ; } return '<select' . Html :: attributes ( $ attributes ) . '>' . $ options_output . '</select>' ; }
Creates a select form input.

<code>
echo Form::select('themes', array('default', 'classic', 'modern'));
</code>

@param string $name       Name
@param array  $options    Options array
@param string $selected   Selected option
@param array  $attributes HTML attributes
@uses   Html::attributes
@return string
Creates a select form input .