Documentation · ViewHelper reference

XSD schema file | vhs master


ViewHelper Debug ViewHelper (sic)

Debugs instances of other ViewHelpers and language structures. Use in conjunction with other ViewHelpers to inspect their current and possible arguments and render their documentation:


Or the same expression in inline syntax:

{variable -> f:format.html() -> v:debug()}

Can also be used to inspect ObjectAccessor instances (e.g. variables you try to access) and rather than just dumping the entire contents of the variable as is done by <f:debug />, this ViewHelper makes a very simple dump with a warning if the variable is not defined. If an object is encountered (for example a domain object) this ViewHelper will not dump the object but instead will scan it for accessible properties (e.g. properties which have a getter method!) and only present those properties which can be accessed, along with the type of variable that property currently contains:

{domainObject -> v:debug()}

Assuming that {domainObject} is an instance of an object which has two methods: getUid() and getTitle(), debugging that instance will render something like this in plain text:

Path: {domainObject}
Value type: object
Accessible properties on {domainObject}:
   {form.uid} (integer)
   {form.title} (string)

The class itself can contain any number of protected properties, but only those which have a getter method can be accessed by Fluid and as therefore we only dump those properties which you can in fact access.


  • Tag usage example

    	<!-- tag content - may be ignored! -->
  • Inline usage example



Argument Description Type
Required attribute

Revision history

commit 20f666791c21fab92964d28e0cda7b3b06eb36a3
Author: Claus Due <*****>
Date:   Sat Nov 23 17:18:35 2013 +0100

    [FEATURE] ViewHelper Debug ViewHelper
    ViewHelper can be used to debug other view helpers to read their argument names and descriptions, and the arguments you provided.
    {someArray -> v:iterator.first() -> v:debug()}
    <v:debug>{someArray -> v:iterator.first()}</v:debug>
    Outputs, for each child ViewHelper ``v:debug`` gets as tag content:
    - VH doc comment
    - list of allowed arguments
    - list of argument values (the "final" values given to the VH)
    - closer description of ``render()`` function
    You can "debug" any ViewHelper this way - ones from the core, from VHS or any other package. You can use it to ensure that the arguments you are passing are getting the correct values after Fluid transforms them to whichever value type you required. And of course it allows a very quick reference to see possible arguments when you don't have any other documentation or don't know which version to look up in docs.

commit d2e531da034976e6db1478eef5a8478595fd16fe
Author: Claus Due <*****>
Date:   Sun Jan 5 00:45:10 2014 +0100

    [TASK] Migrate to using namespace core class names

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit 12ff0ddfb8d36c51f2d3befde7ae812177c80d5d
Author: Xaver Maierhofer <*****>
Date:   Wed Jun 11 00:01:47 2014 +0200

    [TASK] CGL remove use leading backslash
    PHP Docs
    Note that for namespaced names (fully qualified namespace names containing namespace separator, such as Foo\Bar as opposed to global names that do not, such as FooBar),
    the leading backslash is unnecessary and not recommended, as import names must be fully qualified, and are not processed relative to the current namespace.

commit 2944721a3f9d6c31b3164cb3337958d0fdf764d6
Author: Claus Due <*****>
Date:   Fri Jan 16 18:32:10 2015 +0100

    [FEATURE] Allow v:debug to debug ObjectAccessors and values

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to file

commit 97a64e7405af9d95b88c59199e2824f0696f12f4
Author: Claus Due <*****>
Date:   Sun Jan 25 05:41:16 2015 +0100

    [TASK] Fix CGL error

commit f8d2c8f885635465beaa9644bf8c7cdcbe7f815e
Author: Claus Due <*****>
Date:   Mon Jan 26 00:50:37 2015 +0100

    [TASK] Don't use a referenced variable where not needed