1. Go to this page and download the library: Download hokoo/templater 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/ */
hokoo / templater example snippets
use iTRON\Templater\Templater;
$t = new Templater();
/**
* HTML Template
* @var string
*/
$template;
return $t->render( $template, [
'foo',
'bar',
'Where is the title?',
'anything'
] );
return $t->render( $template, [
'foo',
'bar',
[
[ 'tag' => 'repeater_tag_name', 'data' => [ 'Is this a title?', 'anything' ] ],
[ 'tag' => 'repeater_tag_name', 'data' => [ 'There is no title', 'anythingelse' ] ],
]
] );