Re: Default tag handler
| From: | Ivo Jansch | Date: | Mon, 24 Sep 2001 07:16:53 +0000 |
| Subject: | Re: Default tag handler | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1531@lists.php.net to get a copy of this message | ||
Hi,
Andrei Zmievski wrote:
I'm not against it, but could you first give me an idea of how this is useful?1) You could write a function that handles the error gracefully without stopping the rendering of the rest of the page. Or, inside the default handler, you could mail the author of that specific page (which is always in my template vars, and which could be accessed using the $smarty object that gets passed to the function). 2) I have an application that allows very easy creation of new modifiers, by just defining a function for it. It's a bit nasty to loop through all my files and for all modifiers that exist, register them with smarty, so they can be used. No, rather I implement the default modifier, somewhat like this: function default_tag_handler($tag, $args, $smartyobj) { $funcname = $tag."_parse"; if (function_exists($funcname)) $funcname($args, $smartyobj); } And I'm sure there are other uses as well. Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl