woodpecker-email/src/Factory/TwigFactory.php
Simon Vieille 65f4049c28
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
refactor all by using PHP instead of Golang
2024-01-15 12:38:30 +01:00

23 lines
487 B
PHP

<?php
namespace Plugin\Factory;
use Twig\Environment;
use Twig\Loader\FilesystemLoader;
use Twig\Extension\StringLoaderExtension;
use Twig\Extension\DebugExtension;
class TwigFactory
{
public function create(): Environment
{
$loader = new FilesystemLoader(__DIR__.'/../../templates');
$twig = new Environment($loader);
$twig->addExtension(new StringLoaderExtension());
$twig->addExtension(new DebugExtension());
return $twig;
}
}