Use twig/twig with gluephp/glue
Use Composer:
$ composer require gluephp/glue-twig
$app = new Glue\App;
$app->config->override([
'twig' => [
'path' => '/absolute/path/to/templates/folder',
'config' => [
// Additional Twig config, read Twigs
// documentation for more info...
]
],
]);
$app->register(
new Glue\Twig\ServiceProvider()
);
Once the service provider is registered, you can fetch the Twig instance with:
$twig = $app->make('Twig_Environment');
or use the alias:
$twig = $app->twig;