/**
  * Dispatch a call over to Group
  *
  * @param string $method     The method called
  * @param array  $parameters Its parameters
  *
  * @return Group
  */
 public function toGroup($method, $parameters)
 {
     // Disregards if the method isn't "group"
     if ($method != 'group') {
         return false;
     }
     // Create opener
     $group = new Form\Group($this->app, array_get($parameters, 0, null), array_get($parameters, 1, null));
     // Set custom group as true
     Form\Group::$opened = true;
     // Set custom group reference
     Form\Group::$openGroup = $group;
     return $group;
 }
Beispiel #2
0
 /**
  * Add a fieldset to the form
  *
  * Create a fieldset container within the form. A group object is built to be
  * recursable by the form renderer.
  *
  * @return    Nerd\Form\Group
  */
 public function group()
 {
     $fields = func_get_args();
     $group = new Form\Group();
     if ($this->hasWrap()) {
         $group->wrap($this->wrap[0], $this->wrap[1]);
     }
     if ($this->hasFieldWrap()) {
         $group->wrapField($this->fieldWrap[0], $this->fieldWrap[1]);
     }
     foreach ($fields as $field) {
         $group->field($field);
     }
     $this->fields->add($group);
     return $group;
 }