Re: [SMARTY-GENERAL] What are the postfilters for?
| From: | Monte Ohrt | Date: | Sun, 07 Apr 2002 17:29:10 +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-3535@lists.php.net to get a copy of this message | ||
Manfred 'dwerg' Stienstra wrote:
On Sunday 07 April 2002 03:51, Monte Ohrt wrote:The only downside to that is that it is not automated. If there is something you always want applied to all template output, you have to do in in your application each time. Also when you apply your own changes after a fetch, the same performance issues apply (fetch uses output buffering)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?Postfilters are unnecesary, of you want to change the output of a template, just do a fetch and then change it.
If you want to change the compiled code, you should just create a subclass and override the appropriate functionality. I don't think anyone has use for postfilters, so the extra performance downer isn't justified. -- -( dwerg -- Linux.2.4.18.i686 @ dwerg -- Today is Boomtime, the 24th day of Discord in the YOLD 3168 --