-
Notifications
You must be signed in to change notification settings - Fork 35
addDefaultModifier
Umakant Patil edited this page Dec 11, 2013
·
1 revision
Add a modifier to implicitly apply to every variable in a template unless a variable has the nofilter flag.
modifiers is a string or array of strings
jSmart.prototype.addDefaultModifier('escape'); //global modifier for every instance of jSmart
var t = new jSmart(...);
t.addDefaultModifier(["regex_replace:'/bar/':'buh'", 'upper']);
//modifiers for this instance only (applied AFTER global modifiers)
t.fetch(...);
in template :
{$foo = '<b>bar</b>'}
{$foo}
{$foo nofilter}
output :
<B>BUH</B>
<b>bar</b>
see also registerFilter