{eval}
{eval} is used to evaluate a variable as a template. This can be used
for things like embedding template 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.
Attribute NameTypeRequiredDefaultDescriptionvarmixedYesn/avariable (or string) to evaluateassignstringNon/athe template variable the output will be assigned
toTechnical Note
Evaluated variables are treated the same as templates. They follow
the same escapement and security features just as if they were
templates.
Technical Note
Evaluated variables are compiled on every invocation, the compiled
versions are not saved! However if you have
caching
enabled, the
output will be cached with the rest of the template.
{eval}
emphend =
title = Welcome to {$company}'s home page!
ErrorCity = You must supply a {#emphstart#}city{#emphend#}.
ErrorState = You must supply a {#emphstart#}state{#emphend#}.
]]>
Where index.tpl is:
The above example will output:
city.
You must supply a state.
]]>