1. Go to this page and download the library: Download lucid/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/ */
lucid / template example snippets
use Lucid\Template\Engine;
use Lucid\Template\Loader\FilesystemLoader;
$engine = new Engine(new Loader(['path/to/templates']));
$engine->render('partials/content.php', ['title' => 'Hello World!']);
$view->addListener('head.php', new RenderHeadListener($headerData));
use Lucid\Template\Listener\ListenerInterface;
class RenderHeadListener implements ListenerInterface
{
private $data;
public function __construct(array $headerData)
{
$this->data = $data;
}
public function onRender(TemplateDataInterface $data)
{
// add header data to `$data`
}
}
php >= 5.6
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.