gluephp / glue-twig
Use twig templating engine in Glue
0.1.0
2016-05-06 19:38 UTC
Requires
- php: >=5.5.0
- twig/twig: 1.24.*
This package is not auto-updated.
Last update: 2025-01-27 07:33:08 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;