/** * Adds the specified component to the IComponentContainer. * @param IComponent * @param string * @param string * @return void * @throws \InvalidStateException */ public function addComponent(Nette\IComponent $component, $name, $insertBefore = NULL) { parent::addComponent($component, $name, $insertBefore); if ($this->currentGroup !== NULL && $component instanceof IFormControl) { $this->currentGroup->add($component); } }
/** * 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; } }