add twig to container

This commit is contained in:
Yisroel Baum 2026-03-22 10:28:37 +02:00
parent c0f9551c0a
commit e86e3a1238
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 13 additions and 4 deletions

View file

@ -1,9 +1,13 @@
<?php
use DI\Container;
use Slim\Views\Twig;
$container = new Container([
// Note: For production scenarios, cache should be set to some 'path/to/cache'
// to store compiled templates (thus avoiding recompilation on every request).
// For more information, see https://twig.symfony.com/doc/3.x/api.html#environment-options
Twig::class => Twig::create(__DIR__.'/../views/templates', ['cache' => false]),
]);
return $container;