Answer the question
In order to leave comments, you need to log in
Switching from Twig 1.x to Twig 2.x in Source code style?
Good day to all. My web server config Apache/2.4.25 (Unix) PHP/7.1.0 PostgreSQL(libpq) Version 9.5.5 So I decided to continue my project and wanted to upgrade Twig 1.x to Twig 2.x in Source code style. Of the 3 available installation methods, I chose Installing from the tarball release.
An example of my Twig connection
$tpl_path = ROOT_DIR . '/templates/' . $config['cp_tpl'];
require_once ENGINE_DIR . '/lib/Twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem($tpl_path);
$twig = new Twig_Environment($loader, array(
'cache' => ENGINE_DIR . '/cache/twig',
'auto_reload' => true
));
Fatal error: Uncaught Error: Class 'Twig_Loader_Filesystem' not found in /var/www/htdocs/engine/init.php:9 Stack trace: #0 /var/www/htdocs/index.php(6): require_once() #1 {main} thrown in /var/www/htdocs/engine/init.php on line 9
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question