From reading all the documentation. The answer seems to be no. When a template is executed before being embedded into another, that variable is gone and if its value is used in the template, it appears as static text.
In the example of template one, $var
isn't used anywhere, so it is thrown away.
The order of execution would be.
- Load both templates.
- Template one is executed, throwing
$var
away because it wasn't used.
- Template two is executed, embedding the result of template one in it.
If this explanation is incorrect. Please comment or edit it.
But the answer to my question is that the standard templating library doesn't pass template variables between templates. They are meant for local use.