public static function select($name, array $list = array(), $selected, array $attributes = array(), $prompt = false, Closure $optionVisitor = null)
    {
        if ($prompt !== false) {
            // Merge keeping indexes
            $list = array('' => $prompt) + $list;
        }

        $node = new Node\Select($list, $selected, array(), $optionVisitor);

        if ($name !== null) {
            $attributes['name'] = $name;
        }

        return $node->render($attributes);
    }
public static function select($name, array $list = array(), $selected, array $attributes = array(), $prompt = false, Closure $optionVisitor = null)
    {
        if ($prompt !== false) {
            // Merge keeping indexes
            $list = array('' => $prompt) + $list;
        }

        $node = new Node\Select($list, $selected, array(), $optionVisitor);

        if ($name !== null) {
            $attributes['name'] = $name;
        }

        return $node->render($attributes);
    }
public static function select ( $ name , array $ list = array ( ) , $ selected , array $ attributes = array ( ) , $ prompt = false , Closure $ optionVisitor = null ) { if ( $ prompt !== false ) { // Merge keeping indexes $ list = array ( '' => $ prompt ) + $ list ; } $ node = new Node \ Select ( $ list , $ selected , array ( ) , $ optionVisitor ) ; if ( $ name !== null ) { $ attributes [ 'name' ] = $ name ; } return $ node -> render ( $ attributes ) ; }
Creates "Select" element with its child "Option" nodes

@param string $name
@param array $list
@param string|array $select Select child option
@param array $attributes Extra attributes
@param string|boolean $prompt Optional prompt text
@param \Closure $optionVisitor Optional visitor to build attributes of option tag
@return string
Creates Select element with its child Option nodes