Suggestion for $default_modifiers
| From: | Praktikant FV/SLH) | Date: | Fri, 13 Feb 2004 07:20:39 +0000 |
| Subject: | Suggestion for $default_modifiers | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-2108@lists.php.net to get a copy of this message | ||
Hello again,
here a second suggestion:
The default modifiers work just the way as writen in the manual, they are applied to every variable
in the template. That means that even in if-conditions the variable is modified. Which is, as I
think, in most cases useless.
I often use structures like this:
{if $user}
Logged in as: {$user.name}
{/if}
Here the modifier on $user will even call a php warning because of passing an array to a string
modifier (e.g. escape:"htmlall").
So here my suggestion:
You may add an option to say where modifiers are applied. When printing and/or in if-conditions
(there may be more possibilities).
Alternative you may add $default_modifiers for this possible options, so you can modify them more
precisely. That may be usefull, when you for example want to strip all variables, but escape only
the ones which will be printed.
Best regards
Dirk Oschlies