Пример #1
0
 /**
  * (non-PHPdoc)
  * @see \tfc\mvc\form\InputElement::getInput()
  */
 public function getInput()
 {
     if ($this->getType() === 'datetimepicker') {
         $this->setAttribute('format', $this->_format);
         $this->setType('text');
         $format = $this->getAttribute('format');
         $this->setClass($this->getClass() . ' form_' . $format);
     }
     $output = parent::getInput();
     return $output;
 }
Пример #2
0
 /**
  * 添加输入框类和字符串类表单元素
  * @param InputElement $element
  * @param string $tid
  * @return \tfc\mvc\form\FormBuilder
  */
 public function addInputElement(InputElement $element, $tid = '')
 {
     $name = $element->getName(true);
     if (isset($this->values[$name])) {
         $element->value = $this->values[$name];
     }
     if (isset($this->errors[$name])) {
         $element->error = $this->errors[$name];
     }
     if ($tid !== '') {
         $this->_inputElements[$tid][] = $element;
     } else {
         $this->_inputElements[] = $element;
     }
     return $this;
 }