‪TYPO3CMS  9.5
SpeakingLogLevelViewHelper.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
20 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
21 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
22 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
23 
29 class ‪SpeakingLogLevelViewHelper extends AbstractViewHelper
30 {
31  use CompileWithRenderStatic;
32 
38  protected static ‪$usernameRuntimeCache = [];
39 
43  public function ‪initializeArguments(): void
44  {
45  $this->registerArgument('level', 'int', 'Log Level', true);
46  }
47 
56  public static function ‪renderStatic(
57  array $arguments,
58  \Closure $renderChildrenClosure,
59  RenderingContextInterface $renderingContext
60  ): string {
61  return ‪LogLevel::getName($arguments['level']);
62  }
63 }
‪TYPO3\CMS\Adminpanel\ViewHelpers\SpeakingLogLevelViewHelper
Definition: SpeakingLogLevelViewHelper.php:30
‪TYPO3\CMS\Adminpanel\ViewHelpers\SpeakingLogLevelViewHelper\initializeArguments
‪initializeArguments()
Definition: SpeakingLogLevelViewHelper.php:41
‪TYPO3\CMS\Adminpanel\ViewHelpers\SpeakingLogLevelViewHelper\renderStatic
‪static string renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
Definition: SpeakingLogLevelViewHelper.php:54
‪TYPO3\CMS\Adminpanel\ViewHelpers
Definition: IsArrayViewHelper.php:4
‪TYPO3\CMS\Core\Log\LogLevel\getName
‪static string getName($level)
Definition: LogLevel.php:117
‪TYPO3\CMS\Adminpanel\ViewHelpers\SpeakingLogLevelViewHelper\$usernameRuntimeCache
‪static array $usernameRuntimeCache
Definition: SpeakingLogLevelViewHelper.php:36
‪TYPO3\CMS\Core\Log\LogLevel
Definition: LogLevel.php:21