Example #1
0
 public function addField(Field $field)
 {
     // find the row to which this belongs
     $rowName = $field->getRowName();
     /* @var $row \FzyForm\Annotation\Row */
     if (isset($this->rowToFieldset[$rowName])) {
         $fieldset = $this->getChild($this->rowToFieldset[$rowName]);
         $row = $fieldset->getChild($rowName);
     } else {
         $row = new Row(array('name' => $rowName, 'fieldset' => $field->getFieldsetName()));
         $this->addRow($row);
     }
     $row->addChild($field);
     $field->onAddedTo($row);
     return $this;
 }