getOption() public method

Returns user-specific option.
public getOption ( $key, $default = NULL ) : mixed
return mixed
 /**
  * @internal
  * @param \Nette\Forms\ControlGroup $group
  * @return object
  */
 public function processGroup(\Nette\Forms\ControlGroup $group)
 {
     if (!$group->getOption('visual') || !$group->getControls()) {
         return NULL;
     }
     $groupLabel = $group->getOption('label');
     $groupDescription = $group->getOption('description');
     // If we have translator, translate!
     if ($translator = $this->form->getTranslator()) {
         if (!$groupLabel instanceof Html) {
             $groupLabel = $translator->translate($groupLabel);
         }
         if (!$groupDescription instanceof Html) {
             $groupDescription = $translator->translate($groupDescription);
         }
     }
     $controls = array_filter($group->getControls(), function (Controls\BaseControl $control) {
         return !$control->getOption('rendered') && !$control instanceof Controls\HiddenField;
     });
     if (!$controls) {
         return NULL;
         // do not render empty groups
     }
     $groupAttrs = $group->getOption('container', Html::el())->setName(NULL);
     /** @var Html $groupAttrs */
     $groupAttrs->attrs += array_diff_key($group->getOptions(), array_fill_keys(array('container', 'label', 'description', 'visual', 'template'), NULL));
     // fake group
     return (object) (array('controls' => $controls, 'label' => $groupLabel, 'description' => $groupDescription, 'attrs' => $groupAttrs) + $group->getOptions());
 }
 public function renderGroup(ControlGroup $group)
 {
     $this->assertInForm();
     $el = clone $this->prototypes->getControlGroup();
     //group label
     $label = $group->getOption('label');
     if ($label) {
         $this->addContent($el->getPlaceholder('label'), $label);
     } else {
         $el->removePlaceholder('label');
     }
     // group description
     $description = $group->getOption('description');
     if ($description) {
         $this->addContent($el->getPlaceholder('description'), $description);
     } else {
         $el->removePlaceholder('description');
     }
     // master element attributes
     $groupAttrs = $group->getOption('container', Html::el())->setName(NULL);
     $el->addAttributes($groupAttrs->attrs);
     // group content
     $el->addHtml($this->renderPairs($group->getControls()));
     return $el;
 }
 /**
  * @param \Nette\Forms\ControlGroup $group
  *
  * @return object
  */
 protected function buildGroup(Nette\Forms\ControlGroup $group)
 {
     if (!$group->getOption('visual') || !$group->getControls()) {
         return NULL;
     }
     $groupLabel = $group->getOption('label');
     $groupDescription = $group->getOption('description');
     // If we have translator, translate!
     if ($translator = $this->form->getTranslator()) {
         if (!$groupLabel instanceof Html) {
             $groupLabel = $translator->translate($groupLabel);
         }
         if (!$groupDescription instanceof Html) {
             $groupDescription = $translator->translate($groupDescription);
         }
     }
     $controls = $group->getControls();
     // fake group
     return (object) array('template' => $group->getOption('template'), 'controls' => array_filter($controls, function (Controls\BaseControl $control) {
         return !$control->getOption('rendered') && !$control instanceof Controls\HiddenField;
     }), 'label' => $groupLabel, 'description' => $groupDescription);
 }