/** * Método que genera un input tipo password * @param type $field Nombre del input * @param type $attrs Atributos del input * @param type $value Valor por defecto * @param type $label Detalle de la etiqueta label * @param type $help Descripción del campo * @param type $type tipo de campo (text, numeric, etc) * @return string */ public static function pass($field, $attrs = null, $value = null, $label = '', $help = '') { //Tomo los nuevos atributos definidos en las clases $attrs = self::_getAttrsClass($attrs, 'text'); //Armo el input $input = self::getControls(); if (self::$_style == 'form-search' or self::$_style == 'form-inline') { $attrs['placeholder'] = $label; } //Armo el input del form $input .= parent::pass($field, $attrs, $value); //Verifico si el formato del formulario muestra el help if (self::$_help_block) { $input .= self::help($field, $help, $attrs['class']); } //Cierro el controls $input .= self::getControls(); if (!self::$_help_block) { return $input . PHP_EOL; } //Verifico si tiene un label $label = $label && self::$_show_label ? self::label($label, $field, null, $attrs['class']) : ''; return '<div class="control-group">' . $label . $input . '</div>' . PHP_EOL; }
public static function pass($field, $attrs = null, $value = null, $label = '', $req = false, $err = false) { $attrs = self::_getAttrsClass($attrs, 'text', $req); $input = "\n" . parent::pass($field, $attrs, $value) . "\n"; $input .= self::label($field, $label, null, $req, $err); return $input . "\n"; }