Re: [SMARTY-DEV] Output filters

[email protected] ("messju mohr") Wed, 15 Jun 2005 18:06:15 +0200
Newsgroups php.smarty.dev
Message-ID <20050615160615.GI8212@dune>
On Wed, Jun 15, 2005 at 11:22:18PM +1000, AnimeTorrents.com wrote:
> I have been scouring the source for Smarty trying to find how to read
> the currently parsed tpl from the output filter, without enabling debug
> mode, is there a reason this isn't currently possible and would a patch
> to be able to do it be accepted?
> 
> Right now i'm making a htmltidy output filter that logs (emails?) when
> there is bad html output from a template so as I can slowly repair some
> horrid html i'v had thrown at me however I can't always tell what tpl is
> the 'master' generating the mess with just the request uri.
> 
> Alternative suggestions welcomed if anyone has a better idea on how to
> do this.

I would extend class Smarty and override Smarty::fetch() to store the
given template-name in a property of $this and then call
parent::fetch(). the outputfilter can then get it from the $smarty
passed to it.

greetings
messju

> Cameron