The output of {{{foo}}}
or {{&foo}}
will not be escaped by template engine.
array(
"foo" => "Hello & Happy"
)
Hello & Happy
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{{foo}}}";
$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
"foo" => "Hello & Happy"
);
echo $render($data);
{
"foo": "Hello & Happy"
}
Hello & Happy
var Handlebars = require('handlebars');
var template = '{{{foo}}}';
var render = Handlebars.compile(template);
var data = {
"foo": "Hello & Happy"
};
console.log(render(data));
{
"foo": "Hello & Happy"
}
Hello & Happy
var Mustache = require('mustache');
var template = '{{{foo}}}';
var data = {
"foo": "Hello & Happy"
};
console.log(Mustache.render(template, data));
array(
"foo" => "<p>Hello</p>"
)
<p>Hello</p>
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{&foo}}";
$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
"foo" => "<p>Hello</p>"
);
echo $render($data);
{
"foo": "<p>Hello</p>"
}
<p>Hello</p>
var Handlebars = require('handlebars');
var template = '{{&foo}}';
var render = Handlebars.compile(template);
var data = {
"foo": "<p>Hello</p>"
};
console.log(render(data));
{
"foo": "<p>Hello</p>"
}
<p>Hello</p>
var Mustache = require('mustache');
var template = '{{&foo}}';
var data = {
"foo": "<p>Hello</p>"
};
console.log(Mustache.render(template, data));