innmind/templating

This package is abandoned and no longer maintained. The author suggests using the innmind/ui package instead.

Templating

3.2.0 2023-09-16 16:58 UTC

This package is auto-updated.

Last update: 2024-11-20 07:46:04 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