Dump modifier and block tag
1Introduction
The dump modifier and block tag are used to write a textual representation of any data. This is particularly useful during development or debugging, to view the contents of a variable.
They rely on the \Temma\Utils\Dumper object to generate their displays.
Please note that the generated HTML stream uses specific CSS classes. These classes are defined when you use the debug bar. Otherwise, you can define them yourself.
Sample result:
In text version:
2Modifier
2.1Normal use of the modifier
The dump modifier is very easy to use. Just remember to chain the raw modifier to it so that the generated HMTL stream is not escaped (as of Smarty v5.4.0).
Here is an example:
{$var|dump|raw}
2.2Raw text modifier output
It is possible to force a simpler display, in plain text:
{$var|dump:'text'|raw}
3Block tag
3.1Normal use of the block tag
This block tag offers the same result as the modifier. It must be passed a data parameter containing the data to be displayed.
If you place content between the opening and closing tags, it will be ignored.
Example:
{dump data=$var}{/dump}
2.2Raw text output from block tag
It is possible to force a simpler display, in plain text:
{dump data=$var type='text'}{/dump}