Skip to content

Instantly share code, notes, and snippets.

@ebernhardson
Last active August 29, 2015 14:03
Show Gist options
  • Save ebernhardson/94896ce8628d461ce864 to your computer and use it in GitHub Desktop.
Save ebernhardson/94896ce8628d461ce864 to your computer and use it in GitHub Desktop.
<?php
require('src/lightncandy.php');
$template = "{{!-- --}}\n{{#foo}}{{this}}{{/foo}}";
$php = LightnCandy::compile($template, array(
'flags' => LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_THIS
));
echo "Rendered PHP code is:\n$php\n\n";
$renderer = LightnCandy::prepare($php);
echo "Render result:\n";
echo $renderer(Array('foo' => Array(1, 2, 3)));
echo "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment