Last active
August 29, 2015 14:22
-
-
Save kurozumi/bea4a11843b359196b32 to your computer and use it in GitHub Desktop.
【CodeIgniter3】Twig導入用のシンプルライブラリ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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