Skip to content

Instantly share code, notes, and snippets.

@bradberger
Last active August 29, 2015 14:09
Show Gist options
  • Save bradberger/b3840b1533e6153fb3b2 to your computer and use it in GitHub Desktop.
Save bradberger/b3840b1533e6153fb3b2 to your computer and use it in GitHub Desktop.
/vendor/anahita/anahita/vendor/nooku/libraries/koowa/template/abstract.php
private function __sandbox()
{
set_error_handler(array($this, 'handleError'), E_WARNING | E_NOTICE);
$this->getStack()->push(clone $this);
//Extract the data in local scope
extract($this->_data, EXTR_SKIP);
// Capturing output into a buffer
ob_start();
try {
include 'tmpl://'.$this->getStack()->getIdentifier();
$this->_contents = ob_get_clean();
$this->getStack()->pop();
restore_error_handler();
} catch(Exception $e) {
echo $e->getMessage();
$this->_contents = ob_get_clean();
}
return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment