Skip to content

gluephp/glue-twig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twig for Glue

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;

About

Twig adapter for gluephp/glue

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages