/** * Adds fieldset group to the form. * @param string caption * @param bool set this group as current * @return FormGroup */ public function addGroup($caption = NULL, $setAsCurrent = TRUE) { $group = new FormGroup(); $group->setOption('label', $caption); $group->setOption('visual', TRUE); if ($setAsCurrent) { $this->setCurrentGroup($group); } if (isset($this->groups[$caption])) { return $this->groups[] = $group; } else { return $this->groups[$caption] = $group; } }