Smarty eval - what is it for?
Posted: Fri Jun 01, 2007 10:09 pm
The default news module detail template includes the code:
to display the news content.
However just having:
also displays the news content.
So what is "eval" for? The Smarty manual says:
Code: Select all
{eval var=$entry->content}However just having:
Code: Select all
{$entry->content}So what is "eval" for? The Smarty manual says:
but I don't understand how this works in practice although it looks like it could be useful. Is it? And what difference does it make in the news module detail template? It appears to have none.{eval} is used to evaluate a variable as a template. This can be used for things like embedding temaplate tags/variables into variables or tags/variables into config file variables.
If you supply the special "assign" attribute, the output of the {eval} function will be assigned to this template variable instead of being output to the template.