title: Dynamic content with PHP & Smarty
body: <p>I'm using Smarty and utilizing the config_load respective <code>{#VAR#}</code> variables to implement localization. This is working perfectly fine as long as the content is within the templates, but fails as soon as I have to add dynamic content within the TPL file, i.e. with:</p>
  
  <pre><code>{if isset($var) }
      {foreach from=$var item=line}
          {$line}&lt;br&gt;
      {/foreach}
  {/if}
  </code></pre>
  
  <p>Please note each entry within $var contains usually one <code>{#VAR#}</code> entry - and they are <b>not translated</b> (the user will see <code>{#VAR#}</code>).</p>
  
  <p>What is the proper way to implement localization in this case?</p>
  
  <hr>
  
  <p><b>Solution</b></p>
  
  <p>I ended up by only replacing <code>{$line}&lt;br&gt;</code> in the code above with:</p>
  
  <pre><code>{eval var=$line}
  </code></pre>
  
  <p>That did the trick for me.</p>