innmind/templating

3.2.0 2023-09-16 16:58 UTC

This package is auto-updated.

Last update: 2024-04-16 18:18:28 UTC


README

Build Status codecov Type Coverage

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