The parseTemplate hook is triggered before parsing a template. It passes the template object and does not expect a return value. This hook
is useful to transform existing template data or to enrich the template with additional variables or even functions.
Parameters
\Contao\Template$template
The front end or back end template instance.
Examples
The following example will provide an additional variable called foobar in any fe_page template:
The following example provides an additional isMemberOf function in any front end template, which will check whether the currently logged
in member is a member of the given group ID (or IDs):
<!-- templates/my_template.html5 --><?php if ($this->isMemberOf(1)): ?><p>Member belongs to group ID 1!</p><?php endif; ?><?php if ($this->isMemberOf([1, 2])): ?><p>Member belongs to group IDs 1 or 2!</p><?php endif; ?>