‪TYPO3CMS  10.4
ArrayBrowserViewHelper.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
23 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
24 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
25 
30 class ‪ArrayBrowserViewHelper extends AbstractViewHelper
31 {
32  use CompileWithRenderStatic;
33 
39  protected ‪$escapeOutput = false;
40 
44  public function ‪initializeArguments()
45  {
46  $this->registerArgument('data', 'array', 'Array which should be rendered');
47  }
48 
58  public static function ‪renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
59  {
60  $arrayBrowser = GeneralUtility::makeInstance(ArrayBrowser::class);
61  $arrayBrowser->dontLinkVar = true;
62  $arrayBrowser->expAll = true;
63 
64  return $arrayBrowser->tree($arguments['data'], '');
65  }
66 }
‪TYPO3\CMS\Backend\View\ArrayBrowser
Definition: ArrayBrowser.php:31
‪TYPO3\CMS\Backend\ViewHelpers\ArrayBrowserViewHelper
Definition: ArrayBrowserViewHelper.php:31
‪TYPO3\CMS\Backend\ViewHelpers
Definition: ArrayBrowserViewHelper.php:18
‪TYPO3\CMS\Backend\ViewHelpers\ArrayBrowserViewHelper\initializeArguments
‪initializeArguments()
Definition: ArrayBrowserViewHelper.php:42
‪TYPO3\CMS\Backend\ViewHelpers\ArrayBrowserViewHelper\$escapeOutput
‪bool $escapeOutput
Definition: ArrayBrowserViewHelper.php:37
‪TYPO3\CMS\Backend\ViewHelpers\ArrayBrowserViewHelper\renderStatic
‪static string renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
Definition: ArrayBrowserViewHelper.php:56
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46