Re: [SMARTY-DEV] knowing your template
| From: | pobox@verysmall.org | Date: | Tue, 13 Dec 2005 07:55:36 +0000 |
| Subject: | Re: [SMARTY-DEV] knowing your template | ||
| References: | 1 2 3 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2815@lists.php.net to get a copy of this message | ||
messju mohr wrote:
You can automate that very easy. write a prefilter that prepends '{assign var=current_template value=$smarty.template}' to each source. you can access $smarty->get_template_vars('current_template') inside your plugins then. and smarty does the bookkeeping of nesting automagically since it restores the old value of $current_template when the template is left (you cannot change vars of including templates inside included template)Doesn't it make sense to think (for 3.0 or so) of something like - $smarty.template I could see a good use of it for debugging and other purposes. Iv