1. Go to this page and download the library: Download hindy/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/ */
hindy / template example snippets
low\Loader;
Loader::autoload();
$flow = new Loader(array(
'source' => 'path/to/templates', // or ['path/to/templates1', 'path/to/templates2']
'target' => 'path/to/cache',
));
try {
$template = $flow->load('home.html');
$template->display(array(
'data_1' => 'My first data',
'data_2' => 'My second data',
));
} catch (\Exception $e) {
// something went wrong!
die($e->getMessage());
}
low\Loader;
Loader::autoload();
$flow = new Loader(array(
'source' => 'path/to/templates',
'target' => 'path/to/cache',
));
$file = 'my_template.html';
if (!$flow->isValid($file, $error)) {
echo 'The template ' . $file . ' is not valid: ' . $error;
}