Skip to content

Instantly share code, notes, and snippets.

@assertchris
Created January 30, 2014 09:48
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 assertchris/8705463 to your computer and use it in GitHub Desktop.
Save assertchris/8705463 to your computer and use it in GitHub Desktop.
<?php
// https://github.com/teepluss/laravel4-theme/blob/master/src/Teepluss/Theme/Theme.php#L714-L750
class IndexController
extends BaseController
{
public function indexAction()
{
$foo = "bar";
$template = "{{ \$foo }}";
$parsed = Blade::compileString($template);
ob_start();
// extract($data, EXTR_SKIP);
try
{
eval("?>" . $parsed);
}
catch (Exception $e)
{
ob_end_clean();
throw $e;
}
$result = ob_get_contents();
ob_end_clean();
return $result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment