` tags inside a ``, * supports further child `` tags. * * ``` * * Option one * * Grouped option one * Grouped option two * * > * ``` * * @see https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form-select-optgroup * @see https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form-select-option * @see https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form-select */ final class OptgroupViewHelper extends AbstractFormFieldViewHelper { /** * @var string */ protected $tagName = 'optgroup'; public function initializeArguments(): void { $this->registerArgument('additionalAttributes', 'array', 'Additional tag attributes. They will be added directly to the resulting HTML tag.'); $this->registerArgument('data', 'array', 'Additional data-* attributes. They will each be added with a "data-" prefix.'); $this->registerArgument('disabled', 'boolean', 'If true, option group is rendered as disabled', false, false); } public function render(): string { if ($this->arguments['disabled']) { $this->tag->addAttribute('disabled', 'disabled'); } $this->tag->setContent($this->renderChildren()); return $this->tag->render(); } }