/** * Generates control's HTML element. * @return Nette\Web\Html */ public function getControl() { $control = parent::getControl(); if ($this->control->type !== 'password') { $control->value = $this->getValue() === '' ? $this->translate($this->emptyValue) : $this->value; } return $control; }
/** * Generates control's HTML element. * @return Nette\Web\Html */ public function getControl() { $control = parent::getControl(); foreach ($this->getRules() as $rule) { if ($rule->isNegative || $rule->type !== Rule::VALIDATOR) { } elseif ($rule->operation === Form::RANGE && $control->type !== 'text') { list($control->min, $control->max) = $rule->arg; } elseif ($rule->operation === Form::PATTERN) { $control->pattern = $rule->arg; } } if ($control->type !== 'password') { $control->value = $this->getValue() === '' ? $this->translate($this->emptyValue) : $this->value; } return $control; }
/** * Generates control's HTML element. * @return Nette\Web\Html */ public function getControl() { $control = parent::getControl(); $control->setText($this->getValue() === '' ? $this->translate($this->emptyValue) : $this->value); return $control; }