#9: Sub-Templates / Macros
Issue revisions
- closed by Jordi Boggiano at 2008-D-28 2:55
| Type | |
|---|---|
| State | |
| Priority | |
| Resolution | |
| Assigned to | Jordi Boggiano |
| Scheduled for | 1.1.0 |
| Affected versions | |
| Affected components | Plugins |
| Last change | Sunday 28 December 2008 02:55:41 UTC by Jordi Boggiano |
Example:
- {template name="foo" param param2="defaultValue"}
-
{$param}, {$param2}
{/template}
{foo a} => a, defaultValue {foo a b} => a, b
Also you can use {load_templates "filename.tpl"} to load a bunch of templates from an external files (this will however not do anything else with that loaded file)
Also note that templates override plugins which override php functions, and if you define a template twice, the latter will override the former.