Skip to content
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

Clone this wiki locally