‪TYPO3CMS  10.4
OptgroupViewHelper.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 
25 {
29  protected ‪$tagName = 'optgroup';
30 
34  public function ‪initializeArguments()
35  {
36  $this->registerUniversalTagAttributes();
37  $this->registerArgument('additionalAttributes', 'array', 'Additional tag attributes. They will be added directly to the resulting HTML tag.');
38  $this->registerArgument('data', 'array', 'Additional data-* attributes. They will each be added with a "data-" prefix.');
39  $this->registerTagAttribute('label', 'string', 'Human-readable label property for the generated optgroup tag');
40  $this->registerTagAttribute('disabled', 'boolean', 'If true, option group is rendered as disabled', false, false);
41  }
42 
46  public function ‪render()
47  {
48  if ($this->arguments['disabled']) {
49  $this->tag->addAttribute('disabled', 'disabled');
50  } else {
51  $this->tag->removeAttribute('disabled');
52  }
53 
54  $this->tag->setContent($this->renderChildren());
55  return $this->tag->render();
56  }
57 }
‪TYPO3\CMS\Fluid\ViewHelpers\Form\Select\OptgroupViewHelper\$tagName
‪string $tagName
Definition: OptgroupViewHelper.php:28
‪TYPO3\CMS\Fluid\ViewHelpers\Form\Select
Definition: OptgroupViewHelper.php:16
‪TYPO3\CMS\Fluid\ViewHelpers\Form\Select\OptgroupViewHelper
Definition: OptgroupViewHelper.php:25
‪TYPO3\CMS\Fluid\ViewHelpers\Form\Select\OptgroupViewHelper\render
‪string render()
Definition: OptgroupViewHelper.php:45
‪TYPO3\CMS\Fluid\ViewHelpers\Form\Select\OptgroupViewHelper\initializeArguments
‪initializeArguments()
Definition: OptgroupViewHelper.php:33
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper
Definition: AbstractFormFieldViewHelper.php:30