diff options
author | Daniel Weipert <code@drogueronin.de> | 2022-01-27 10:29:07 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2022-01-27 10:29:07 +0100 |
commit | 27a1680fe386db99fd983eba64533091b9451d27 (patch) | |
tree | cb0eb55fb281c9af492b587399f895400ea1c2da /src/Template.php | |
parent | 10c86197f1f63e222dfc9e937911e35ab500a208 (diff) |
Add layout to home route
Diffstat (limited to 'src/Template.php')
-rw-r--r-- | src/Template.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Template.php b/src/Template.php index b4360b8..9c0b0d6 100644 --- a/src/Template.php +++ b/src/Template.php @@ -3,6 +3,7 @@ namespace Elements; use Twig\Environment; +use Twig\Extension\DebugExtension; use Twig\Loader\FilesystemLoader; class Template @@ -12,7 +13,11 @@ class Template public static function init(): void { $loader = new FilesystemLoader(dirname(__DIR__) . '/templates'); - self::$twig = new Environment($loader); + self::$twig = new Environment($loader, [ + 'debug' => true, + ]); + + self::$twig->addExtension(new DebugExtension()); } public static function render(string $name, array $context = []): string |