【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