Re: Adding modifiers and function to plug-ins
| From: | Ron Dyck | Date: | Wed, 13 Feb 2002 21:44:35 +0000 |
| Subject: | Re: Adding modifiers and function to plug-ins | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2685@lists.php.net to get a copy of this message | ||
> On Wed, 13 Feb 2002, Ron Dyck wrote:
> > I'm having trouble adding modifiers and functions to the plug-in
directory.
> > After adding the file: 'modifier.format_paragraph.php' with the
appropriate
> > function, I get this error:
> > Warning: Smarty plugin error: [in index.tpl line 24]: plugin function
> > smarty_modifier_format_paragraph() not found in
> >
/home/admin/sites/develop/Smarty-20020208/plugins/modifier.format_paragraph.
> > php
> >
> > Do the modifiers and function need to be registered somewhere?
>
> What is your function called inside modifier.format_paragraph.php?
function smarty_modifier_format_paragraph($text)
{
$text = str_replace("\r","",$text);
$text = str_replace("\n","<br>",$text);
return $text;
}