PHP code example of milpa / template

1. Go to this page and download the library: Download milpa/template 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/ */

    

milpa / template example snippets


use Milpa\Template\LatteEngine;
use Milpa\Template\Template;

$engine = new LatteEngine(
    viewPath: __DIR__ . '/resources/views',
    cacheDir: __DIR__ . '/storage/cache',
    sharedViewsDir: __DIR__ . '/resources/views',   // layouts every plugin may extend
);

echo (new Template($engine))->render('pages/home.latte', ['title' => 'Hello']);