LightnCandy option: FLAG_NAMEDARG

Enable named arguments support for partials and helpers.

Sample Codes

Default is not supporting named arguments,

Data:
array(
  "abc" => "NO",
  "abc=123" => "YES"
)
Template:
{{foo abc=123}}!
Result:
OK=YES!

Check the code to know used helper codes

Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo abc=123}}!";

$php = LightnCandy::compile($template, array(
  "helpers" => array(
    "foo" => function ($a) {
      return "OK=$a";
    }
  )
));
$render = LightnCandy::prepare($php);
$data = array(
  "abc" => "NO",
  "abc=123" => "YES"
);
echo $render($data);

Default is not supporting named arguments,

Used option: FLAG_NAMEDARG

Data:
array(
  "abc" => "NO",
  "abc=123" => "YES"
)
Template:
{{foo abc=123}}!
Result:
OK=123!

Check the code to know used helper codes

Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo abc=123}}!";

$php = LightnCandy::compile($template, array(
  "flags" => LightnCandy::FLAG_NAMEDARG,
  "helpers" => array(
    "foo" => function ($option) {
      return "OK={$option['hash']['abc']}";
    }
  )
));
$render = LightnCandy::prepare($php);
$data = array(
  "abc" => "NO",
  "abc=123" => "YES"
);
echo $render($data);

See Also...