Re: [SMARTY-GENERAL] What are the postfilters for?

From: Date: Sun, 07 Apr 2002 17:30:58 +0000
Subject: Re: [SMARTY-GENERAL] What are the postfilters for?
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3536@lists.php.net to get a copy of this message
So maybe it would be good to change the postfilter functionality to apply to the template output instead of the template script itself. Any objections? Gabor Hojtsy wrote:
These are good points. A couple of issues I can think of: 1) Output buffering would have to be used to manipulate the output of the php scripts. Probably not a big deal, but a slight performance issue to every non-cached page hit, which brings us to #2... 2) As it stands, the postfilters execute once at compile time (so maybe these would be more accurately described as template compile pre/post filters.) A filter that acts on the output of the compiled template would have to execute on every hit to the page... although it would get cached with template caching turned on, so then it would only happen each time the page expires. Thoughts?
Pre/Postfilters should have been named "compile time filters" or something like that. I personnaly also thought, that postfilters are executed after all the variable substitution, on the final HTML code. I tried to use this for a custom TransSID function, where I search for URLs and transform them in my way (search engine friendly URLs, with no ? in them ;), something like: /company/info/SID_HERE.html I grabbed the output of the fetch function, and applied my function to that output, so that was not too hard to implement... Goba


« previous php.smarty.general (#3536) next »