Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
class Twig
public function __construct()
$this->ci =& get_instance();
$loader = new Twig_Loader_Filesystem(VIEWPATH);
$this->twig = new Twig_Environment($loader, array('cache' => APPPATH . "cache/twig", "debug" => true));
public function display($name, array $context = array())
$this->ci->output->set_output($this->twig->render($name, $context));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment