Documentation · ViewHelper reference

DebugViewHelper


This ViewHelper generates a HTML dump of the tagged variable.

Examples

Simple

<f:debug>{testVariables.array}</f:debug>

Output

foobarbazfoo

All Features

<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>

Output

[A HTML view of the var_dump]

/
  • Tag usage example

    <f:debug title="NULL" maxDepth="123" plainText="1" ansiColors="1" inline="1" blacklistedClassNames="{foo: 'bar'}" blacklistedPropertyNames="{foo: 'bar'}">
    	<!-- tag content - may be ignored! -->
    </f:debug>
  • Inline usage example

    {f:debug(title: 'NULL', maxDepth: 123, plainText: 1, ansiColors: 1, inline: 1, blacklistedClassNames: {foo: 'bar'}, blacklistedPropertyNames: {foo: 'bar'})}

Arguments

Argument Description Type
ansiColors

If TRUE, ANSI color codes is added to the plaintext output, if FALSE (default) the plaintext debug output not colored.

boolean
blacklistedClassNames

An array of class names (RegEx) to be filtered. Default is an array of some common class names.

array
blacklistedPropertyNames

An array of property names and/or array keys (RegEx) to be filtered. Default is an array of some common property names.

array
inline

if TRUE, the dump is rendered at the position of the tag. If FALSE (default), the dump is displayed at the top of the page.

boolean
maxDepth

Sets the max recursion depth of the dump (defaults to 8). De- or increase the number according to your needs and memory limit.

integer
plainText

If TRUE, the dump is in plain text, if FALSE the debug output is in HTML format.

boolean
title

optional custom title for the debug output

string
Required attribute

Revision history

commit 38ebcedd944471b83d9293b648264fd3e65634f1
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue May 5 20:52:33 2009 +0000

    Fluid:
    * Changes backported from FLOW3:
      * major cleanup and refactoring of core and view helper classes & comments
      * added validation for boolean arguments in AbstractViewHelper
      * added initialize-method to AbstractViewHelper, that is called before render(). This was especially needed for tagbased viewhelpers.
      * renderChildren() now directly calls evaluateChildNodes() on the respective view helper node allowing us to render objects/arrays.
      * improved boolean type conversion for arguments in ViewHelperNode.
      * added TagBuilder class, re-wrote all tag based view helpers to use it (see form view helpers for some examples)
      * ViewHelperArguments collection got a new method "hasArgument()" that returns TRUE when the specified argument exists and is not NULL
    * tx_fluid changes:
      * Improved fake object factory. Now objects are injected to subclasses and implementations of the specified classes/interfaces.
      * cleaned up and tweaked view helpers. Removed Parsefunc, Stdwrap and TypoScript view helpers for now. Added CObject, If/Then/Else, EmailLink, Crop, Currency, Debug, HTML, Nl2br, Image view helpers. Thanks to Sebastian Böttger, Christopher Hlubek, Niels Pardon, Andreas Pattynama for the help!
    * Note: Unit tests not fully backported yet.

commit 6422d744a92e6d2b64f59ab45ba8ff3e3fadfcda
Author: Bastian Waidelich <*****@typo3.org>
Date:   Wed May 6 18:21:16 2009 +0000

    Fluid:
    * removed obsolete compatibility classes and replaced references with the respective extbase classes
    * added ob_start() to debug view helper

commit 50af6b9c08d04e3e1d4ce56a499a9a3d4b84efc3
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Thu May 28 21:45:46 2009 +0000

    Fluid:
    * Backported major changes from Fluid v5 to Fluid v4
    * !!! Many of these changes are not backwards-compatible! Please read this if you have written custom ViewHelpers!
    * Introduced Shorthand Syntax for calling ViewHelpers
    * Core:
    ** Lots of internal cleanup and refactorings.
    ** !!! Complete restructuring into subpackages.
    * ViewHelpers:
    ** !!! The base classes of ViewHelpers changed to Tx_Fluid_Core_ViewHelper_AbstractViewHelper and Tx_Fluid_Core_ViewHelper_TagBasedViewHelper. Please adjust your ViewHelpers!
    ** !!! $this->variableContainer has been renamed to $this->templateVariableContainer
    ** !!! the view is not in $this->variableContainer anymore. Currently there is no way to fetch the View from a ViewHelper.
    ** Introduced a new $this->controllerContext containing the context variables of the controller
    ** !!! The request can be now found in $this->controllerContext->getRequest()
    ** !!! The URIHelper has been renamed to URIBuilder and can be now found in $this->controllerContext->getURIBuilder()
    ** Introduced a new ViewHelperVariableContainer, available in $this->viewHelperVariableContainer to pass data between ViewHelpers. Should only be needed in very rare cases.
    ** !!! Removed <f:format.htmlEscape> ViewHelper! Please remove these declarations in your template! Escaping of object accessors is now automatically done, see next point.
    * !!! ObjectAccessors {...} are now automatically HTMLspecialChar'd if not used as an argument to a ViewHelper. This is done using a new ObjectAccessorPostProcessor. Lateron, this will be made configurable.

commit 186bdaeac89820779f91853b830cc95d60c7ad58
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue Jul 13 09:42:26 2010 +0000

    [-TASK] Fluid: R*****@version annotation from all Fluid classes to ease the backporting process. Relates to #8835 (backported from Fluid package)

commit 1d36de6ed90007e324b773782e8f0a1d1c1191a2
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue Jul 13 10:12:30 2010 +0000

    [-TASK] Fluid: R*****@package/@subpackage annotations from all Fluid classes. They have already been removed in FLOW3 packages in r2813.

commit dd8928aed4c119d8db37322acb91ded24ba5cc35
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Dec 30 16:21:11 2010 +0000

    [+TASK] Fluid (ViewHelpers): Fix, cleanup and extend inline documentation of ViewHelpers
    
    Resolves #10908

commit ff414cd605fa57e9b4c944aa70fd8423d89a800c
Author: Michael Klapper <michael.klapper+*****@gmail.com>
Date:   Sat Jul 9 17:14:02 2011 +0200

    [+BUGFIX] Use of depreciated function debug in debugViewHelper
    
    Change-Id: Id04327bbf03b833c01a46ae4734ed84cccb5d53c
    Fixes: #27970

commit fd09d197fa8886b97cb20aa9573f39cd08ce989e
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Nov 10 18:27:58 2011 +0100

    [TASK] S*****@author annotations
    
    This backports three recent changes of the TYPO3.Fluid package:
    - R*****@license annotation from files (290f4f5)
    - Simplify license header in PHP files (14bacba)
    - D*****@author tags from source code (9c2e837)
    
    This should not contain any functional change!
    
    Change-Id: I9376dca4af78c4f0f82413011d115b8ad04634dd

commit 860a5b07a5cfcb278e3af7eeb850fed5e3593fdd
Author: Alexander Schnitzler <*****@typovision.de>
Date:   Tue Jan 10 21:42:23 2012 +0100

    [TASK] The DebugViewHelper now utilizes the Extbase Debugger.
    
    Wraps Tx_Extbase_Utility_Debugger::var_dump() (enhanced
    backport of FLOW3).
    
    Introduces new arguments for <f:debug>:
    
    * maxDepth (int) default 8
    * plainText (bool) default FALSE
    * ansiColors (bool) default FALSE
    * inline (bool) default FALSE
    * blacklistedClassNames (array) default NULL
    * blacklistedPropertyNames (array) default NULL
    
    Change-Id: I05d5fcbadbda4429c414faec5e1901e30e59fcdd
    Resolves: #33900
    Releases: 4.7

commit ec3891d8d4e339d8319428211207e6201be9fd73
Author: Thomas Maroschik <*****@dfau.de>
Date:   Wed Oct 17 21:18:26 2012 +0200

    [TASK][WIP] Move non class code back to source files
    
    Change-Id: I620d2e61860142cdc89cc83474c95542799961c0

commit 554e8f890dcc0dd86a27518b58e2b54be26fd37e
Author: Thomas Maroschik <*****@dfau.de>
Date:   Wed Oct 17 22:20:17 2012 +0200

    [TASK] Namespace classes
    
    Change-Id: Ia7432e1c923826ed58206bca15fb94509adbd508

commit 9d46e6932d35c79bf87c96fa38b8e537c4192f23
Author: Alexander Schnitzler <*****@typovision.de>
Date:   Tue Nov 20 16:27:02 2012 +0100

    [CLEANUP] Adjust code to CGL and fix small namespace bugs
    
    * whitespaces, tabs and blank line issues
    * bool -> boolean
    * int -> integer
    * fix wrong namespace annotations
    
    Fixes: #43157
    Releases: 6.0
    Change-Id: I8397948e19248db029d8efd1555ee56e4982742d
    Reviewed-on: http://review.typo3.org/16619
    Reviewed-by: Helmut Hummel
    Tested-by: Helmut Hummel

commit 77f29a3c69a7cbb27b34072754aa503bace6c9f1
Author: Christian Kuhn <*****@schwarzbu.ch>
Date:   Tue Oct 1 14:40:56 2013 +0200

    [TASK] Remove closing PHP tags
    
    Change-Id: Iaa92566c53301e49396fc9fb26b0b339c48d567b
    Resolves: #52360
    Releases: 6.2
    Reviewed-on: https://review.typo3.org/24212
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn
    Reviewed-by: Ernesto Baschny
    Tested-by: Ernesto Baschny
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring