/**
* Adds fieldset group to the form.
* @param string caption
* @param bool set this group as current
* @return ControlGroup
*/
public function addGroup($caption = NULL, $setAsCurrent = TRUE)
{
$group = new ControlGroup();
$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;
}
}