PHP code example of setono / php-templates-bundle
1. Go to this page and download the library: Download setono/php-templates-bundle 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-bundle example snippets
// config/bundles.php
return [
// ...
Setono\PhpTemplatesBundle\SetonoPhpTemplatesBundle::class => ['all' => true],
// ...
];
use Setono\PhpTemplates\Engine\EngineInterface;
final class YourService
{
/** @var EngineInterface */
private $engine;
public function __construct(EngineInterface $engine) {
$this->engine = $engine;
}
public function __invoke(): string
{
return $this->engine->render('YourNamespace/template', [
'parameter' => 'value'
]);
}
}
bash
$ composer