PHP code example of template-interop / latte-adapter

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

    

template-interop / latte-adapter example snippets




use Interop\Template\Latte\LatteEngine;

$latte = new Latte\Engine;
$latte->setLoader(new Latte\Loaders\FileLoader(__DIR__.'/templates'));
$engine = new LatteEngine($latte);
echo $engine->render('greeting', ['name' => 'John']);