Jump to the millipedia homepage
millipedia

Debugging smarty

I just had to fix a templating issue on a live site and wanted to use var_dump to see what smarty info was available. Obviously I didn't want that information showing up on the live site so I put in a smarty conditional that checked for a query parameter

{if $smarty.get.debug eq 1}

//whatever code you want to see here. 
{get_template_vars}

{/if}
Then if you just add ?debug=1 to your URL then you'll see the information but your site visitors won't.
May 17, 2012
in : CMSMS ,