Re: [SMARTY-GENERAL] What are the postfilters for?
| From: | Andrei Zmievski | Date: | Sun, 07 Apr 2002 18:20:27 +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-3542@lists.php.net to get a copy of this message | ||
At 12:29 PM 4/7/02 -0500, 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)What's the problem? class My_Smarty extends Smarty {
...
function display($template, $cache_id = null, $compiled_id = null)
{
$content = $this->fetch($template, $cache_id, $compile_id);
// apply processing to $content;
echo $content;
}
}
$smarty = new My_Smarty();
...
$smarty->display('my_template.tpl');
-Andrei