‪TYPO3CMS  10.4
DebugViewHelper.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 
19 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
20 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
21 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
22 
54 class ‪DebugViewHelper extends AbstractViewHelper
55 {
56  use CompileWithRenderStatic;
57 
63  protected ‪$escapeChildren = false;
64 
70  protected ‪$escapeOutput = false;
71 
77  public function ‪initializeArguments()
78  {
79  $this->registerArgument('title', 'string', 'optional custom title for the debug output');
80  $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);
81  $this->registerArgument('plainText', 'bool', 'If TRUE, the dump is in plain text, if FALSE the debug output is in HTML format.', false, false);
82  $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);
83  $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);
84  $this->registerArgument('blacklistedClassNames', 'array', 'An array of class names (RegEx) to be filtered. Default is an array of some common class names.');
85  $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.');
86  }
87 
97  public static function ‪renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
98  {
99  return ‪DebuggerUtility::var_dump($renderChildrenClosure(), $arguments['title'], $arguments['maxDepth'], (bool)$arguments['plainText'], (bool)$arguments['ansiColors'], (bool)$arguments['inline'], $arguments['blacklistedClassNames'], $arguments['blacklistedPropertyNames']);
100  }
101 }
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper
Definition: DebugViewHelper.php:55
‪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:518
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\renderStatic
‪static string renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
Definition: DebugViewHelper.php:94
‪TYPO3\CMS\Extbase\Utility\DebuggerUtility
Definition: DebuggerUtility.php:41
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\$escapeChildren
‪bool $escapeChildren
Definition: DebugViewHelper.php:61
‪TYPO3\CMS\Fluid\ViewHelpers
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\initializeArguments
‪initializeArguments()
Definition: DebugViewHelper.php:74
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\$escapeOutput
‪bool $escapeOutput
Definition: DebugViewHelper.php:67