LightnCandy option: FLAG_PROPERTY

Support object instance attribute access; you must apply this if your data contains object.

This flag cause bad rendering performance, do not enable it unless you need this feature anyway.

Sample Codes

The default behavior: only do associative array lookup

Data:
array(
  "foo" => array(
    "key" => "OK"
  ),
  "bar" => (object)Array('key' => 'Good')
)
Template:
{{foo.key}}, {{bar.key}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo.key}}, {{bar.key}}";

$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => array(
    "key" => "OK"
  ),
  "bar" => (object)Array('key' => 'Good')
);
echo $render($data);

do instance property lookup

Used option: FLAG_PROPERTY

Data:
array(
  "foo" => array(
    "key" => "OK"
  ),
  "bar" => (object)Array('key' => 'Good')
)
Template:
{{foo.key}}, {{bar.key}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo.key}}, {{bar.key}}";

$php = LightnCandy::compile($template, array(
  "flags" => LightnCandy::FLAG_PROPERTY
));
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => array(
    "key" => "OK"
  ),
  "bar" => (object)Array('key' => 'Good')
);
echo $render($data);