/** * an element to add to the form * @param Element $element * @throws BuilderException * @return $this; */ public function add(Element $element) { if (!$this->currentGroup) { throw new BuilderException("Call to add() impossible, no group opened," . "you probably didn't open a group or you closed to many groups"); } $this->currentGroup->addElement($element); $this->lastElement = $element; return $this; }
/** * an element to add to the form * @param Element $element * @throws BuilderException * @return $this; */ public function add(Element $element) { if (!$this->currentGroup) { throw new BuilderException('Call to add() impossible, no group opened,' . "you probably didn't open a group or you closed to many groups"); } $this->currentGroup->addElement($element); $this->lastElement = $element; if ($element instanceof Element\Validatable) { $element->addValidator(new IsValid()); } return $this; }
public function addElement(Element $element) { if (!$element instanceof Tab) { throw new InvalidArgumentException("element", "Instance of Tab", $element, "Cannot add non-tab element into TabGroup"); } parent::addElement($element); }
/** * Adds a column to the group. Column can only receive column as child. * @param Element $element */ public function addElement(Element $element) { if (!$element instanceof Column) { throw new InvalidArgumentException("element", "Instance of Column", $element, "Cant add non-column element into columnGroup"); } parent::addElement($element); }