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\Anatomy\Templater;
$templater = new Templater();
return $templater->render( $html, [
'title' => 'The Best Title',
'content' => 'Anything you want',
] );
// This is a container.
// It can contain blocks and texts.
$content = new \iTRON\Anatomy\Container();
// Let's put block "article" into the container.
$content->addBlock( 'article', [
'title' => 'The Best Title',
'content' => 'Anything you want',
] );
// Another one.
$content->addBlock( 'article', [
'title' => 'There is no title',
'content' => 'There is no content.',
] );
// Or you can add a plain text.
$content->addText( 'Plain text.' );
$templater = new iTRON\Anatomy\Templater();
return $templater->render( $html, [
'title' => "Feed's Title",
'content' => $content
] );