2
Hello, I’m having a hard time implementing the Twig
in my project MVC
, I’m using namespaces, autoloader all that stuff from PSR-0
.
I would like the hope of you to implement why I’m already 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
If you are using PSR-0 why not simply include the vendor/autoload.php and give a use in the Twig class ?
– gmsantos
I tried to do this, but it starts from the error in other classes inside Twig, I don’t know what interface blah blah. rs
– Edgard Hufelande