Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Can a Template Toolkit template know if it has been PROCESSed or INCLUDEd?by petdance (Parson) |
on Sep 25, 2014 at 15:32 UTC ( [id://1101984]=perlquestion: print w/replies, xml ) | Need Help?? |
petdance has asked for the wisdom of the Perl Monks concerning the following question:
I have some Template Toolkit templates that must only be invoked with INCLUDE, not PROCESS, because they set variables that could have global side effects, and INCLUDE localizes the variables before handling the template.
I would like to put some sort of assertion in the template that checks to see if it was called with INCLUDE and not PROCESS. In order to do that, I need to be able to tell, in the template, how the template was invoked. Is this possible to do in TT?
Thanks,
Back to
Seekers of Perl Wisdom
|
|