Kernel/Html.php
static function select($name, array $values, $val, $text, $selected, $padrao = null, $attr = array())
    {
        $html = '<select ';
        $attr = array_merge(array("name" => $name), $attr);
        $html .= self::getAttributes($attr);
        $html .= ">";

        if ($padrao != null)
            $html .= '<option value="">' . $padrao . '</option>';

        foreach ($values as $value) {
            if (isset($value->$val) and isset($value->$text))
                $html .= '<option value="' . $value->$val . '" ' . ($value->$val == $selected ? " selected " : "") . '>' . $value->$text . '</option>';
        }

        $html .= "</select>";

        echo $html;
    }
static function select($name, array $values, $val, $text, $selected, $padrao = null, $attr = array())
    {
        $html = '<select ';
        $attr = array_merge(array("name" => $name), $attr);
        $html .= self::getAttributes($attr);
        $html .= ">";

        if ($padrao != null)
            $html .= '<option value="">' . $padrao . '</option>';

        foreach ($values as $value) {
            if (isset($value->$val) and isset($value->$text))
                $html .= '<option value="' . $value->$val . '" ' . ($value->$val == $selected ? " selected " : "") . '>' . $value->$text . '</option>';
        }

        $html .= "</select>";

        echo $html;
    }
static function select ( $ name , array $ values , $ val , $ text , $ selected , $ padrao = null , $ attr = array ( ) ) { $ html = '<select ' ; $ attr = array_merge ( array ( "name" => $ name ) , $ attr ) ; $ html .= self :: getAttributes ( $ attr ) ; $ html .= ">" ; if ( $ padrao != null ) $ html .= '<option value="">' . $ padrao . '</option>' ; foreach ( $ values as $ value ) { if ( isset ( $ value -> $ val ) and isset ( $ value -> $ text ) ) $ html .= '<option value="' . $ value -> $ val . '" ' . ( $ value -> $ val == $ selected ? " selected " : "" ) . '>' . $ value -> $ text . '</option>' ; } $ html .= "</select>" ; echo $ html ; }
Cria um select Html
@param $name - Nome do campo
@param array $values - array com os objetos com os valores
@param $val - campo do objeto que contem o dado que deve ser o value do option
@param $text - campo do objeto que contem o dado que deve ser o texto do option
@param $selected - valor que deve vim selecionado
@param null $padrao - Texto que deve ser inserido antes de todos os itens
@param array $attr - atributos para adicionar na tag select
Cria um select Html