innmind / templating
Templating
3.2.0
2023-09-16 16:58 UTC
Requires
- php: ~8.2
- innmind/filesystem: ~5.0|~6.0
- innmind/immutable: ~4.0|~5.0
- innmind/url: ~4.0
- twig/twig: ^3.3.8
Requires (Dev)
- innmind/coding-standard: ~2.0
- phpunit/phpunit: ~9.0
- vimeo/psalm: ~4.22
This package is auto-updated.
Last update: 2024-10-16 19:20:31 UTC
README
Library to wrap php template engines (currently only twig).
Installation
composer require innmind/templating
Usage
use Innmind\Templating\Factory; use Innmind\Templating\Name; use Innmind\Url\Path; $render = Factory::build( Path::of('templates/dir'), Path::of('/tmp/cache'), // optional Map::of(), // optional, variables accesible everywhere in templates ); $rendered = $render(new Name('template.html.twig')); // Instance of Innmind\Filesystem\File\Content