Set Delimiter

Use = to set delimiters from {{ and }} to customized tag

Samples

handlebars.js do not support changing delimiters

lightncandy
Data:
array(
  "foo" => "World"
)
Template:
Hello, {{foo}}.
{{=<* *>=}}Now, <*foo*>
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "Hello, {{foo}}.\n{{=<* *>=}}Now, <*foo*>";

$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "World"
);
echo $render($data);
handlebars.js
Data:
{
  "foo": "World"
}
Template:
Hello, {{foo}}.
{{=<* *>=}}Now, <*foo*>
Result:
Parse error on line 2:
Hello, {{foo}}.{{=<* *>=}}Now, <*foo*
-----------------^
Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'EQUALS'
Source Code
var Handlebars = require('handlebars');
var template = 'Hello, {{foo}}.\n{{=<* *>=}}Now, <*foo*>';

var render = Handlebars.compile(template);
var data = {
  "foo": "World"
};
console.log(render(data));
mustache
Data:
{
  "foo": "World"
}
Template:
Hello, {{foo}}.
{{=<* *>=}}Now, <*foo*>
Result:
Hello, World.
Now, World
Source Code
var Mustache = require('mustache');
var template = 'Hello, {{foo}}.\n{{=<* *>=}}Now, <*foo*>';

var data = {
  "foo": "World"
};
console.log(Mustache.render(template, data));

Set delimiters will not change into a partial

lightncandy
Partials:
world{{foo}}!
bar<<bar>>
Data:
array(
  "foo" => "World"
)
Template:
Hello, {{=[[ ]]=}}
[[> world]]
[[> bar]]
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "Hello, {{=[[ ]]=}}\n[[> world]]\n[[> bar]]";

$php = LightnCandy::compile($template, array(
  "partials" => array(
    "world" => "{{foo}}!",
    "bar" => "<<bar>>"
  )
));
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "World"
);
echo $render($data);
handlebars.js
Partials:
world{{foo}}!
bar<<bar>>
Data:
{
  "foo": "World"
}
Template:
Hello, {{=[[ ]]=}}
[[> world]]
[[> bar]]
Result:
Parse error on line 1:
Hello, {{=[[ ]]=}}[[> world]
---------^
Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'EQUALS'
Source Code
var Handlebars = require('handlebars');
var template = 'Hello, {{=[[ ]]=}}\n[[> world]]\n[[> bar]]';

var render = Handlebars.compile(template);
var data = {
  "foo": "World"
};
console.log(render(data, {
 partials: {
  "world": "{{foo}}!",
  "bar": "<<bar>>"
}}));
mustache
Partials:
world{{foo}}!
bar<<bar>>
Data:
{
  "foo": "World"
}
Template:
Hello, {{=[[ ]]=}}
[[> world]]
[[> bar]]
Result:
Hello, 
World!<<bar>>
Source Code
var Mustache = require('mustache');
var template = 'Hello, {{=[[ ]]=}}\n[[> world]]\n[[> bar]]';

var data = {
  "foo": "World"
};
console.log(Mustache.render(template, data, {
  "world": "{{foo}}!",
  "bar": "<<bar>>"
}));