LightnCandy option: FLAG_PARENT

Support {{..}} or {{../foo}} in template. Otherwise, {{..}} or {{../foo}} will cause template error.

Sample Codes

Error when compile {{..}}

Used option: FLAG_ERROR_LOG

Data:
NULL
Template:
{{../foo}}OK
Result:
Do not support {{../var}}, you should do compile with LightnCandy::FLAG_PARENT flag
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{../foo}}OK";

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

Enable handlebars.js extension {{..}}

Used option: FLAG_PARENT

Data:
NULL
Template:
{{../foo}}OK
Result:
OK
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{../foo}}OK";

$php = LightnCandy::compile($template, array(
  "flags" => LightnCandy::FLAG_PARENT
));
$render = LightnCandy::prepare($php);
$data = NULL;
echo $render($data);

See Also...