Re: register_modifier -> Call to undefined function:
| From: | Justin Patrin | Date: | Tue, 24 Feb 2004 21:38:06 +0000 |
| Subject: | Re: register_modifier -> Call to undefined function: | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11020@lists.php.net to get a copy of this message | ||
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 - davidYou could always put the funciton in a file in your $plugins_dir and have it autoloaded. -- paperCrane <Justin Patrin>