ComponentPro UltimateTemplateEngine

Passing parameters to another template

Language Filter: AllSend comments on this topic to ComponentPro

You can define a template in either a templateclass or main template. For dynamic template content generation, UltimateTemplateEngine offers a convenient way to define parameters for templates, as shown in the example below:

Example Title
{%template mytemplate a,b,c%} {! mytemplate requires parameters: a,b and c !}


a + b + c = $a + b + c$

{$template%}

{%rendertemplate mytemplate a=10 b=44 c=26/}

The output will be:

a + b + c = 80

If the required parameters are not provided, UltimateTemplateEngine will search for them in the global variable list. If not found, an error will be written to the output string.