‪TYPO3CMS  ‪main
DebugViewHelper.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 
21 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
22 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
23 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
24 
56 final class ‪DebugViewHelper extends AbstractViewHelper
57 {
58  use CompileWithRenderStatic;
59 
65  protected ‪$escapeChildren = false;
66 
72  protected ‪$escapeOutput = false;
73 
74  public function ‪initializeArguments(): void
75  {
76  $this->registerArgument('title', 'string', 'optional custom title for the debug output');
77  $this->registerArgument('maxDepth', 'int', 'Sets the max recursion depth of the dump (defaults to 8). De- or increase the number according to your needs and memory limit.', false, 8);
78  $this->registerArgument('plainText', 'bool', 'If TRUE, the dump is in plain text, if FALSE the debug output is in HTML format.', false, false);
79  $this->registerArgument('ansiColors', 'bool', 'If TRUE, ANSI color codes is added to the plaintext output, if FALSE (default) the plaintext debug output not colored.', false, false);
80  $this->registerArgument('inline', 'bool', 'if TRUE, the dump is rendered at the position of the <f:debug> tag. If FALSE (default), the dump is displayed at the top of the page.', false, false);
81  $this->registerArgument('blacklistedClassNames', 'array', 'An array of class names (RegEx) to be filtered. Default is an array of some common class names.');
82  $this->registerArgument('blacklistedPropertyNames', 'array', 'An array of property names and/or array keys (RegEx) to be filtered. Default is an array of some common property names.');
83  }
84 
88  public static function ‪renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
89  {
91  $renderChildrenClosure(),
92  $arguments['title'],
93  $arguments['maxDepth'],
94  $arguments['plainText'],
95  $arguments['ansiColors'],
96  $arguments['inline'],
97  $arguments['blacklistedClassNames'],
98  $arguments['blacklistedPropertyNames']
99  );
100  }
101 }
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\renderStatic
‪static renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
Definition: DebugViewHelper.php:85
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper
Definition: DebugViewHelper.php:57
‪TYPO3\CMS\Extbase\Utility\DebuggerUtility\var_dump
‪static string var_dump( $variable, string $title=null, int $maxDepth=8, bool $plainText=false, bool $ansiColors=true, bool $return=false, array $blacklistedClassNames=null, array $blacklistedPropertyNames=null)
Definition: DebuggerUtility.php:490
‪TYPO3\CMS\Extbase\Utility\DebuggerUtility
Definition: DebuggerUtility.php:41
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\$escapeChildren
‪bool $escapeChildren
Definition: DebugViewHelper.php:63
‪TYPO3\CMS\Fluid\ViewHelpers
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\initializeArguments
‪initializeArguments()
Definition: DebugViewHelper.php:71
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\$escapeOutput
‪bool $escapeOutput
Definition: DebugViewHelper.php:69