Hello, I'm having a hard time implementing Twig
in my project MVC
, I'm using namespaces, autoloader all that PSR-0
thing.
I'd like your judah to implement because I'm almost freaking out. rs
public function render($file, $data = null){
require_once LIB . '/Twig/Autoloader.php';
\Twig_Autoloader::register();
$loader = new \Lib\Twig_Loader_Filesystem('/path/to/templates');
$twig = new Twig_Environment($loader, array(
'cache' => '/path/to/compilation_cache',
));
}
This is my method that will render the template, so far I have the following error:
Exception: Controller Twig_Autoloader not found. in C:\UwAmp\www\system\engine\autoload.php