title: How to get all assigned Smarty variables while running the template?
body: <p>I would like to get all variables assigned to Smarty inside the template. For example, if I have this code</p>
  
  <pre><code>$smarty-&gt;assign('name', 'Fulano');
  $smarty-&gt;assign('age', '22');
  $result = $this-&gt;smarty-&gt;fetch("file:my.tpl");
  </code></pre>
  
  <p>I would like to have a <code>my.tpl</code> like the one below:</p>
  
  <pre><code>{foreach from=$magic_array_of_variables key=varname item=varvalue}
  {$varname} is {$varvalue}
  {/foreach}
  </code></pre>
  
  <p>such as the content of result would be</p>
  
  <pre><code>name is Fulano
  age is 22
  </code></pre>
  
  <p>So, is there a way to get this <code>$magic_array_of_variables</code>?</p>