예제 #1
0
 public function addElement(Element $element)
 {
     if ($element instanceof Element) {
         $this->elements[$element->getName()] = $element;
     } else {
         throw new Exception('Element must be specified by string or Life\\Form\\Element instance');
     }
     return $this;
 }
예제 #2
0
 public function addElement(Element $element, $name = null, $options = null)
 {
     if ($element instanceof Element) {
         if (null === $name) {
             $name = $element->getName();
         }
         $this->elements[$element->getAttrib('id')] = $element;
     } else {
         throw new Exception('Element must be specified by string or Life\\Form\\Element instance');
     }
     $this->order[$name] = $this->elements[$name]->getOrder();
     $this->orderUpdated = true;
     return $this;
 }