tags:

views:

210

answers:

2

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).

+1  A: 

Solved this with a Custom Resource.

clops
+1  A: 

without a custom resource, you could have just used an {include file="your/template.tpl"}. Or render the template from the database in code using $smarty->fetch("your/template.tpl") and assigning that to $valueFromDatabase.

pocketfullofcheese