-
Notifications
You must be signed in to change notification settings - Fork 35
auto_literal
Umakant Patil edited this page Oct 13, 2017
·
3 revisions
jSmart.prototype.auto_literal
The Smarty delimiters (default { and } ) will be ignored so long as there are one or more whitespace symbols after left delimiter or one or more whitespace symbols before right delimiter. This behavior can be disabled by setting jSmart.prototype.auto_literal to false.
<script>
jSmart.prototype.auto_literal = false;
var tpl = new jSmart(' { $foo } ', { autoLiteral: false }); // Or pass locally which overrides jSmart.prototype.auto_literal
tpl.fetch({foo:'bar'}); //will return ' bar '
</script>
see also Escaping Smarty Parsing in PHP Smarty documentation