Eval Smarty Code inside a Smarty Template

Posted by clops on Stack Overflow See other posts from Stack Overflow or by clops
Published on 2010-02-17T14:55:03Z Indexed on 2010/04/10 23:03 UTC
Read the original article Hit count: 544

Filed under:

Hi,

is there a way to evaluate Smarty Code inside an existing Smarty template? For example, I may have the following construct:

smartyTemplate.tpl

<body>
  <div id="dynamicPart">
     {$valueFromDatabase}
  </div>
</body>

Whereas the Smarty variable $valueFromDatabase contains another Smarty Template which I would like to be inserted in place of the variable and then evaluated as a template (with all the logic expressions in replacements neccessary).

© Stack Overflow or respective owner

Related posts about smarty