Install TWIG template engine stand alone, without composer

php, templates, twig

Solution

Rename your `twig` folder to `Twig`, and then change your include:

require_once('Twig/Autoloader.php');

It should work now.

Problem

I want to install and use Twig as in a module and I copied the contents of the /lib/twig/ contents to to a folder called /twig in my modules folder. I've in put require_once('twig/Autoloader.php'); at the top of my module and I use Twig_Autoloader::register() to try and get it work but as soon as I use ``` $this->loader = new Twig_Loader_Filesystem($path); $this->twig = new Twig_Environment($this->loader, array( //options )); ``` And I get this error: Fatal error: Class 'Twig_Loader_Filesystem' not found in How do I resolve this?

Original source