gluephp / glue-twig
Use twig templating engine in Glue
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/gluephp/glue-twig
Requires
- php: >=5.5.0
- twig/twig: 1.24.*
This package is not auto-updated.
Last update: 2025-10-06 10:46:33 UTC
README
Use twig/twig with gluephp/glue
Installation
Use Composer:
$ composer require gluephp/glue-twig
Configure 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... ] ], ]);
Register Twig
$app->register( new Glue\Twig\ServiceProvider() );
Get the Twig instance
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;