TYPO3 CMS  TYPO3_8-7
ActionMenuItemGroupViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 
39 {
43  protected $tagName = 'optgroup';
44 
51  public function initializeArguments()
52  {
53  parent::initializeArguments();
54  $this->registerArgument('label', 'string', 'label', false, '');
55  }
56 
60  public function render()
61  {
62  $label = $this->arguments['label'];
63 
64  $this->tag->addAttribute('label', $label);
65  $options = '';
66  foreach ($this->childNodes as $childNode) {
67  if ($childNode instanceof ViewHelperNode && $childNode->getViewHelperClassName() === ActionMenuItemViewHelper::class) {
68  $options .= $childNode->evaluate($this->renderingContext);
69  }
70  }
71  $this->tag->setContent($options);
72  return $this->tag->render();
73  }
74 
82  public function compile($argumentsName, $closureName, &$initializationPhpCode, ViewHelperNode $node, TemplateCompiler $compiler)
83  {
84  // @TODO: replace with a true compiling method to make compilable!
85  $compiler->disable();
86  return null;
87  }
88 }
compile($argumentsName, $closureName, &$initializationPhpCode, ViewHelperNode $node, TemplateCompiler $compiler)