Skip to content

Left and right delimiter

pfaciana edited this page Sep 25, 2019 · 2 revisions

Latte.prototype.ldelim / Latte.prototype.rdelim

You can change default delimiters { and } assigning Latte.prototype.ldelim and Latte.prototype.rdelim

<script>

    Latte.prototype.ldelim = '<!--{';
    Latte.prototype.rdelim = '}-->';

    var tpl = new Latte('{$foo}:<!--{$foo}-->', {ldelim: '<!--{', rdelim: '}-->'}); //Or they can be passed locally and they would override delimiters passed by prototype.

    tpl.fetch({foo:'bar'});  //will return '{$foo}:bar'

script>

see also Escaping Smarty Parsing in PHP Smarty documentation and Latte.prototype.auto_literal

Clone this wiki locally