PHP code example of innmind / templating

1. Go to this page and download the library: Download innmind/templating library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

innmind / templating example snippets


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