Suggestion for $default_modifiers

"Oschlies Dirk (Praktikant FV/SLH)" <[email protected]>
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
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

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.