Re: [SMARTY] Smarty 'unescape' variable modifier ?
| From: | messju mohr | Date: | Wed, 24 Mar 2004 17:38:37 +0000 |
| Subject: | Re: [SMARTY] Smarty 'unescape' variable modifier ? | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11176@lists.php.net to get a copy of this message | ||
On Wed, Mar 24, 2004 at 09:22:14AM -0800, Kelly Hallman wrote:
> Mar 24 at 5:30pm, Artur Pydo wrote:
> > Artur Pydo wrote:
> > > I would like to display them and was looking for a
> > > 'unescape' modifier in Smarty.
> >
> > I had messju's and Curus answer on IRC :
> > {$var|stripslashes}
> >
> > stripslashes() is a php function but there is no need to
> > use register_modifier for php functions.
>
> MAAANNNN!! Smarty never stops blowing me away.. I have read most all of
> the documentation (I thought) and was not aware of this..
>
> This works with ANY php built-in?
> Is it documented anywhere that I can read more about it?
sure: http://smarty.php.net/manual/en/language.modifiers.php
:
"Modifiers can be autoloaded from your $plugins_dir (also see: Naming
Conventions) or can be registered explicitely (see:
register_modifier). Additionally all php-functions can be used as
modifiers implicitely. (The @count-example above actually uses php's
count-function and not a smarty-modifier)."
But (AFAIR) this was just documented recently.
> Also, I have been meaning to test this, but if I declare a function named
> Smarty_modifier_xyz() is it used as if it were a registered plugin?
no, smarty_modifer_*() is only for autoloaded modifiers loaded via modifier.*.php
> --
> Kelly Hallman
> // Ultrafancy