Skip to content

Instantly share code, notes, and snippets.

@cuchac
Forked from gtraxx/Debug smarty with firebug
Created September 2, 2014 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuchac/e2042f8b3e723e0a07bc to your computer and use it in GitHub Desktop.
Save cuchac/e2042f8b3e723e0a07bc to your computer and use it in GitHub Desktop.
Shows all Smarty variables in tree-view directly in console. Always available and easy to access
{* Smarty *}
{capture name='_smarty_debug' assign=debug_output}
<script type="text/javascript">
// <![CDATA[
window.smarty ={};
{if $assigned_vars != null}
{foreach $assigned_vars as $vars}
window.smarty['{$vars@key|escape:'javascript'}'] = {$vars|@json_encode nofilter};
{/foreach}
{/if}
console.dir(window.smarty)
// ]]>
</script>
{/capture}
{$debug_output nofilter}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment