예제 #1
0
 /**
  * An internal method for creating a template from a form field
  *
  * @param String $type A string describing this field type
  * @param \r8\iface\Form\Field $field
  * @return NULL
  */
 private function addField($type, \r8\iface\Form\Field $field)
 {
     if (!$field->isHidden()) {
         $tpl = clone $this->fieldTpl;
         $tpl->set("type", $type);
         $tpl->set("field", $field->__toString());
         $tpl->set("label", $field->getLabelTag()->__toString());
         $tpl->set("errors", $this->getErrorTpl($field->validate()));
         $tpl->set("showErrors", $this->showErrors);
         $this->fields->add($tpl);
     }
 }