Re: [SMARTY-DEV] knowing your template
[email protected] ("messju mohr") Tue, 13 Dec 2005 10:40:43 +0100
| Newsgroups | php.smarty.dev |
|---|---|
| Message-ID | <20051213094043.GD15899@dune> |
On Tue, Dec 13, 2005 at 08:55:36AM +0100, [email protected] wrote: > 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 $smarty.template is always available explicitly, it's just not available to php land implicitly. what's your problem. (search the archives, we already had this discussion at smarty-dev) > I could see a good use of it for debugging and other purposes. > > Iv