LightnCandy option: FLAG_ECHO

compile to echo 'a', $b, 'c'; to improve performance. This will slow down rendering when the template and data are simple, but will improve 5% ~ 10% when the data is big and looping in the template.

Sample Codes

compile to 'a' . $b . 'c' when do not use FLAG_ECHO

Used option: FLAG_JSTRUE

Data:
NULL
Template:
A{{{foo}}}C
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "A{{{foo}}}C";

$php = LightnCandy::compile($template, array(
  "flags" => LightnCandy::FLAG_JSTRUE
));

echo $php

compile to echo 'a', $b, 'c' by default

Used option: FLAG_ECHO

Data:
NULL
Template:
A{{{foo}}}C
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "A{{{foo}}}C";

$php = LightnCandy::compile($template, array(
  "flags" => LightnCandy::FLAG_ECHO
));

echo $php

See Also...