schranz-templating / laravel-twig-integration
A integration of template renderer into laravel via twig template engine.
Package info
github.com/schranz-templating/laravel-twig-integration
pkg:composer/schranz-templating/laravel-twig-integration
Requires
- php: ^7.0 || ^8.0
- illuminate/support: ^8.0 || ^9.0
- illuminate/view: ^8.0 || ^9.0
- schranz-templating/twig-adapter: ^0.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Integrate the templating Twig Adapter into the Laravel Framework.
Part of the Schranz Templating Project.
Installation
Install this package via Composer:
composer require schranz-templating/laravel-twig-integration
Depending on the projects setup maybe following need to be added to the config/app.php:
'providers' => [ // ... Schranz\Templating\Integration\Laravel\Twig\SchranzTemplatingTwigProvider::class, ],
Configuration
The example and default configuration can be found in config/schranz_templating_twig.php.
Extensions
To extend Twig functionality you can create a new service implementing the Twig\Extension\ExtensionInterface,
the service need to be tagged with twig.extension to be registered as Twig Extension:
$app->tag(\App\Twig\MyExtension::class, 'twig.extension');
Read more about Twig Extensions in the Twig documentation.