‪TYPO3CMS  11.5
FlagValueViewHelper.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 
18 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
19 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
20 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
21 
26 class ‪FlagValueViewHelper extends AbstractViewHelper
27 {
28  use CompileWithRenderStatic;
29 
33  public function ‪initializeArguments()
34  {
35  $this->registerArgument('flags', 'int', '', true);
36  }
37 
47  public static function ‪renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
48  {
49  $flags = (int)$arguments['flags'];
50 
51  if ($flags > 0) {
52  $content = ($flags & 128 ? '<title>' : '')
53  . ($flags & 64 ? '<meta/keywords>' : '')
54  . ($flags & 32 ? '<meta/description>' : '');
55  return $content;
56  }
57  return '';
58  }
59 }
‪TYPO3\CMS\IndexedSearch\ViewHelpers\Format\FlagValueViewHelper
Definition: FlagValueViewHelper.php:27
‪TYPO3\CMS\IndexedSearch\ViewHelpers\Format
Definition: DateTimeViewHelper.php:16
‪TYPO3\CMS\IndexedSearch\ViewHelpers\Format\FlagValueViewHelper\renderStatic
‪static string renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
Definition: FlagValueViewHelper.php:46
‪TYPO3\CMS\IndexedSearch\ViewHelpers\Format\FlagValueViewHelper\initializeArguments
‪initializeArguments()
Definition: FlagValueViewHelper.php:32