1. Go to this page and download the library: Download setono/php-templates 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/ */
setono / php-templates example snippets
// render.php
use Setono\PhpTemplates\Engine\Engine;
$engine = new Engine();
$engine->addPath('templates/php');
echo $engine->render('@App/hello', [
'name' => 'John Doe',
]);
// override.php
use Setono\PhpTemplates\Engine\Engine;
$engine = new Engine();
$engine->addPath('vendor/namespace/src/templates/php'); // The path is added with a default priority of 0
$engine->addPath('templates/php', 10); // Here we set the priority higher than the vendor added path