‪TYPO3CMS  10.4
InstallationStateCssClassViewHelper.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 
27 class ‪InstallationStateCssClassViewHelper extends AbstractViewHelper
28 {
29  use CompileWithRenderStatic;
30 
34  public function ‪initializeArguments()
35  {
36  $this->registerArgument('needle', 'string', '', true);
37  $this->registerArgument('haystack', 'array', '', true);
38  }
39 
52  public static function ‪renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
53  {
54  $needle = $arguments['needle'];
55  $haystack = $arguments['haystack'];
56  if (array_key_exists($needle, $haystack)) {
57  if (isset($haystack[$needle]['installed']) && $haystack[$needle]['installed'] === true) {
58  return 'installed';
59  }
60  return 'available';
61  }
62  return '';
63  }
64 }
‪TYPO3\CMS\Extensionmanager\ViewHelpers\InstallationStateCssClassViewHelper\renderStatic
‪static string renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
Definition: InstallationStateCssClassViewHelper.php:51
‪TYPO3\CMS\Extensionmanager\ViewHelpers
‪TYPO3\CMS\Extensionmanager\ViewHelpers\InstallationStateCssClassViewHelper\initializeArguments
‪initializeArguments()
Definition: InstallationStateCssClassViewHelper.php:33
‪TYPO3\CMS\Extensionmanager\ViewHelpers\InstallationStateCssClassViewHelper
Definition: InstallationStateCssClassViewHelper.php:28