Here is my project's structure:
app/
Life/
Forms
Formhandler.php
Page
Pagehandler.php
start.php
vendor/
composer/
autoload.php
index.php
The index.php requires start.php which then requires the composer autoload.php:
//start.php
<?php
require_once __DIR__ . '/../vendor/autoload.php';
This is a working structure, until I added Twig into the composer. Here's is what my composer.json looks like now:
{
"autoload": {
"psr-4": {
"Life\\" : "app/Life"
}
},
"require": {
"twig/twig" : "~1.0"
}
}
I far as I know, Twig doesn't support psr-4 for now and the only way I know is to require it in composer this way but with the "require" included I encounter an error like: Class 'Life\Page\Twig_Autoloader' not found.
What am I missing here?