22 lines
426 B
PHP
22 lines
426 B
PHP
<?php
|
|
|
|
namespace Ardent\Game;
|
|
|
|
use Twig\Environment;
|
|
use Twig\Loader\FilesystemLoader;
|
|
|
|
class renderer
|
|
{
|
|
private Environment $twig;
|
|
|
|
public function __construct()
|
|
{
|
|
$loader = new FilesystemLoader('../templates');
|
|
$this->twig = new Environment($loader);
|
|
}
|
|
|
|
public function render(string $template, array $data = []): string
|
|
{
|
|
return $this->twig->render($template, $data);
|
|
}
|
|
} |