Skip to content

Instantly share code, notes, and snippets.

@ptica
Created September 28, 2014 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptica/e3fe8e1937fef379b251 to your computer and use it in GitHub Desktop.
Save ptica/e3fe8e1937fef379b251 to your computer and use it in GitHub Desktop.
require_once(ROOT . DS . APP_DIR . '/Vendor/zordius/lightncandy/src/lightncandy.php');
$path = preg_replace('/\.ctp$/', '.hbs', __FILE__);
$template = file_get_contents($path);
$phpStr = LightnCandy::compile($template);
$renderer = LightnCandy::prepare($phpStr);
echo $renderer($data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment