Example #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()) {
         return;
     }
     if ($this->showErrors) {
         $errors = $this->getErrors($field->validate());
     } else {
         $errors = "";
     }
     $this->fields .= "        <tr class='form-field form-" . $type . "'>\n" . "            <th>" . $field->getLabelTag() . "</th>\n" . "            <td>" . $errors . $field . "</td>\n" . "        </tr>\n";
 }
Example #2
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);
     }
 }