Do not do any HTML escape on {{var}}
. This option is same with handlbars.js noEscape option.
The default behavior is escaping values.
array(
"foo" => "Love & <b>Peace</b>"
)
Love & <b>Peace</b>
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";
$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
"foo" => "Love & <b>Peace</b>"
);
echo $render($data);
Do not escaping values.
Used option: FLAG_NOESCAPE
array(
"foo" => "Love & <b>Peace</b>"
)
Love & <b>Peace</b>
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";
$php = LightnCandy::compile($template, array(
"flags" => LightnCandy::FLAG_NOESCAPE
));
$render = LightnCandy::prepare($php);
$data = array(
"foo" => "Love & <b>Peace</b>"
);
echo $render($data);