Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
 /**
  * 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;
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 /**
  * 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);
 }