‪TYPO3CMS  9.5
DebugViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
19 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
20 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
21 
53 class ‪DebugViewHelper extends AbstractViewHelper
54 {
55  use CompileWithRenderStatic;
56 
62  protected ‪$escapeChildren = false;
63 
69  protected ‪$escapeOutput = false;
70 
76  public function ‪initializeArguments()
77  {
78  $this->registerArgument('title', 'string', 'optional custom title for the debug output');
79  $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);
80  $this->registerArgument('plainText', 'bool', 'If TRUE, the dump is in plain text, if FALSE the debug output is in HTML format.', false, false);
81  $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);
82  $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);
83  $this->registerArgument('blacklistedClassNames', 'array', 'An array of class names (RegEx) to be filtered. Default is an array of some common class names.');
84  $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.');
85  }
86 
96  public static function ‪renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
97  {
98  return ‪DebuggerUtility::var_dump($renderChildrenClosure(), $arguments['title'], $arguments['maxDepth'], (bool)$arguments['plainText'], (bool)$arguments['ansiColors'], (bool)$arguments['inline'], $arguments['blacklistedClassNames'], $arguments['blacklistedPropertyNames']);
99  }
100 }
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper
Definition: DebugViewHelper.php:54
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\renderStatic
‪static string renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
Definition: DebugViewHelper.php:93
‪TYPO3\CMS\Extbase\Utility\DebuggerUtility
Definition: DebuggerUtility.php:24
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\$escapeChildren
‪bool $escapeChildren
Definition: DebugViewHelper.php:60
‪TYPO3\CMS\Fluid\ViewHelpers
Definition: BaseViewHelper.php:2
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\initializeArguments
‪initializeArguments()
Definition: DebugViewHelper.php:73
‪TYPO3\CMS\Extbase\Utility\DebuggerUtility\var_dump
‪static string var_dump($variable, $title=null, $maxDepth=8, $plainText=false, $ansiColors=true, $return=false, $blacklistedClassNames=null, $blacklistedPropertyNames=null)
Definition: DebuggerUtility.php:496
‪TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\$escapeOutput
‪bool $escapeOutput
Definition: DebugViewHelper.php:66