23 lines
449 B
PHP
23 lines
449 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Template;
|
|
|
|
use Twig\Environment;
|
|
use Twig\Loader\ArrayLoader;
|
|
use App\Template\TwigExtension;
|
|
|
|
final class Twig extends Environment
|
|
{
|
|
/**
|
|
* @param string[] $templates Array of templates
|
|
*/
|
|
public function __construct(array $templates)
|
|
{
|
|
$loader = new ArrayLoader($templates);
|
|
parent::__construct($loader);
|
|
$this->addExtension(new TwigExtension());
|
|
}
|
|
}
|