default modifiers

From: Date: Wed, 17 Jul 2002 14:32:47 +0000
Subject: default modifiers
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-204@lists.php.net to get a copy of this message
Default modifiers took about 2 lines of code to add :-) Some questions, first about syntax... string or array of values? // just tack the string onto the var $default_modifiers = '|mod1|mod2:"foo"|mod3'; // implode the values and tack them on $default_modifiers = array('mod1','mod2:"foo"','mod3'); For my test, I went with the first one because its simple. The only advantage the second one has is if we ever changed the syntax for modifiers. Default modifiers affect all vars, including config file vars. I suspect that would be the intended behavior. Also, default modifiers preceed any modifiers exlicitly given. So in your template you have {$var|upper}, and your default modifier is |escape:"htmlall", then your var will end up like {$var|escape:"htmlall"|upper} The last issue is how to handle vars you don't want affected by default modifiers. Should there be a way to disable default modifiers for a certain var, or do you just explicitly string more modifiers on to "undo" them? example, {$var|unescape} turns into {$var|escape:"htmlall"|unescape} Monte

« previous php.smarty.dev (#204) next »