Skip a delimiter when it behind \ .
The default behavior: \ do nothing
array(
"foo" => "OK"
)Yes, is \Yes, OK is \OKrequire('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "Yes, {{foo}} is \\{{foo}}";
$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
"foo" => "OK"
);
echo $render($data);
You can use this way to display {{ when you do not like to use \
array(
"foo" => "OK"
)Show in this wayShow {{ in this wayrequire('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "Show {{#with \"{{\"}}{{.}}{{/with}} in this way";
$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
"foo" => "OK"
);
echo $render($data);
Use \ to escape a delimiter
Used option: FLAG_SLASH
array(
"foo" => "OK"
)Yes, is \Yes, OK is require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "Yes, {{foo}} is \\{{foo}}";
$php = LightnCandy::compile($template, array(
"flags" => LightnCandy::FLAG_SLASH
));
$render = LightnCandy::prepare($php);
$data = array(
"foo" => "OK"
);
echo $render($data);