forked from umakantp/jsmart
-
Notifications
You must be signed in to change notification settings - Fork 2
auto_literal
pfaciana edited this page Sep 25, 2019
·
2 revisions
Latte.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 Latte.prototype.auto_literal to false.
<script>
Latte.prototype.auto_literal = false;
var tpl = new Latte(' { $foo } ', { autoLiteral: false }); // Or pass locally which overrides Latte.prototype.auto_literal
tpl.fetch({foo:'bar'}); //will return ' bar '
</script>
see also Escaping Smarty Parsing in PHP Smarty documentation