示例#1
0
文件: TextInput.php 项目: krecek/nrsn
	/**
	 * Generates control's HTML element.
	 * @return NHtml
	 */
	public function getControl()
	{
		$control = parent::getControl();
		foreach ($this->getRules() as $rule) {
			if ($rule->isNegative || $rule->type !== NRule::VALIDATOR) {

			} elseif ($rule->operation === NForm::RANGE && $control->type !== 'text') {
				list($control->min, $control->max) = $rule->arg;

			} elseif ($rule->operation === NForm::PATTERN) {
				$control->pattern = $rule->arg;
			}
		}
		if ($control->type !== 'password') {
			$control->value = $this->getValue() === '' ? $this->translate($this->emptyValue) : $this->value;
		}
		return $control;
	}
 public function getControl($label = NULL)
 {
     return parent::getControl();
 }
示例#3
0
 public function getInput()
 {
     $control = parent::getControl();
     $control->value = $this->value === '' ? $this->emptyValue : $this->tmpValue;
     return $control;
 }
示例#4
0
文件: TextArea.php 项目: krecek/nrsn
	/**
	 * Generates control's HTML element.
	 * @return NHtml
	 */
	public function getControl()
	{
		$control = parent::getControl();
		$control->setText($this->getValue() === '' ? $this->translate($this->emptyValue) : $this->value);
		return $control;
	}
示例#5
0
文件: loader.php 项目: GE3/GE3
 function getControl()
 {
     $control = parent::getControl();
     if ($this->control->type !== 'password') {
         $control->value = $this->getValue() === '' ? $this->translate($this->emptyValue) : $this->value;
     }
     return $control;
 }