/** Генерация тега INPUT для фильтра. Значение будет подставлено если оно проходит валидацию */ public function asInput($attr = null, $value = null) { if (is_null($value)) { $value = $this->getCleanValue(); } return HTML::Input($this->getColumn(), $value, $attr); }
function testInput() { $i = HTML::Input('hello', 123); $this->assertSelectCount('input[type=text]', true, $i, 'Тип'); $this->assertSelectCount('input[name=hello]', true, $i, 'Имя'); $this->assertSelectCount('input[value=123]', true, $i, 'Значение'); $i = HTML::Hidden('hello', 123, 'myclass'); $this->assertSelectCount('input[class=myclass]', true, $i, 'Атрибуты'); }
/** Отрисовка элемента */ public function render() { return HTML::Input($this->getName(), $this->getTaintedValue(), $this->getAttributes()); }