Re: [SMARTY] Re: register_modifier -> Call to undefined function:
| From: | messju mohr | Date: | Tue, 24 Feb 2004 21:45:14 +0000 |
| Subject: | Re: [SMARTY] Re: register_modifier -> Call to undefined function: | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11022@lists.php.net to get a copy of this message | ||
On Tue, Feb 24, 2004 at 01:38:06PM -0800, Justin Patrin wrote:
> David Förster wrote:
>
> >Hello,
> >
> >I want to register a modifier which just returns a given string for
> >testing.
> >The registration seems to work but when I use it in a template I get an
> >error saying
> >'Call to undefined function: smarty_modifier_addSmileys'.
> >
> >Something seems to go wrong because my custom function should be
> >called..
> >
> >This is what I do:
> >
> >$tpl->register_modifier('addSmileys', 'addSmileys');
> >
> >function addSmileys($string)
> >{
> > return $string;
> >}
> >
> >And in the template:
> >
> >{$message.text|escape:"htmlall"|nl2br|addSmileys}
> >
> >(The registration should work because it gives me an error when I use a
> >non existent function.
> >
> >Any help is appreciated
> >
> >- david
>
> You could always put the funciton in a file in your $plugins_dir and
> have it autoloaded.
Or (if you don't have $tpl->security set) you can omit the call to
register_modifier. all php-functions can be used as modifiers with
security set off.
>
> --
> paperCrane <Justin Patrin>