Merge "[TASK] Increase version number"
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / DebugViewHelper.php
1 <?php
2
3 /* *
4 * This script is part of the TYPO3 project - inspiring people to share! *
5 * *
6 * TYPO3 is free software; you can redistribute it and/or modify it under *
7 * the terms of the GNU General Public License version 2 as published by *
8 * the Free Software Foundation. *
9 * *
10 * This script is distributed in the hope that it will be useful, but *
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
12 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
13 * Public License for more details. *
14 * */
15
16 /**
17 * This ViewHelper generates a HTML dump of the tagged variable.
18 *
19 * = Examples =
20 *
21 * <code title="Simple">
22 * <f:debug>{testVariables.array}</f:debug>
23 * </code>
24 * <output>
25 * foobarbazfoo
26 * </output>
27 *
28 * <code title="All Features">
29 * <f:debug title="My Title" maxDepth="5" blacklistedClassNames="{0:'Tx_BlogExample_Domain_Model_Administrator'}" plainText="TRUE" ansiColors="FALSE" inline="TRUE" blacklistedPropertyNames="{0:'posts'}">{blogs}</f:debug>
30 * </code>
31 * <output>
32 * [A HTML view of the var_dump]
33 * </output>
34 */
35 class Tx_Fluid_ViewHelpers_DebugViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
36
37 /**
38 * A wrapper for Tx_Extbase_Utility_Debugger::var_dump().
39 *
40 * @param string $title optional custom title for the debug output
41 * @param integer $maxDepth Sets the max recursion depth of the dump (defaults to 8). De- or increase the number according to your needs and memory limit.
42 * @param boolean $plainText If TRUE, the dump is in plain text, if FALSE the debug output is in HTML format.
43 * @param boolean $ansiColors If TRUE, ANSI color codes is added to the plaintext output, if FALSE (default) the plaintext debug output not colored.
44 * @param boolean $inline 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.
45 * @param array $blacklistedClassNames An array of class names (RegEx) to be filtered. Default is an array of some common class names.
46 * @param array $blacklistedPropertyNames An array of property names and/or array keys (RegEx) to be filtered. Default is an array of some common property names.
47 * @return string
48 */
49 public function render($title = NULL, $maxDepth = 8, $plainText = FALSE, $ansiColors = FALSE, $inline = FALSE, $blacklistedClassNames = NULL, $blacklistedPropertyNames = NULL) {
50 return Tx_Extbase_Utility_Debugger::var_dump($this->renderChildren(), $title, $maxDepth , (bool)$plainText, (bool)$ansiColors, (bool)$inline, $blacklistedClassNames, $blacklistedPropertyNames);
51 }
52 }
53
54 ?>