I have some variables inside a template and I don't know where I assigned them. I need to know what is inside a particular variable; for instance, say I have a variable in smarty called member
. I tried with {debug}
but it didn't work, and no popup was shown.
How can I output/debug smarty variables using something like var_dump()
inside the templates?
If you want something prettier I would advise
just replace yourvariable by your variable
You can use
{php}
tagsMethod 1 (won't work in Smarty 3.1 or later):
Method 2:
Method 3:
just use {debug} in your .tpl and look at your sourcecode
Try out with the Smarty Session:
or
To beautify your output, use it between
<pre> </pre>
tagsin smarty V3 you can use this
{var_dump($variable)}
try this .... Set
$debugging
to TRUE in Smarty.