From a1c3bea6e5fbb26bfbd185c77d86173ba7006507 Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Mon, 25 Nov 2024 20:33:04 -0500 Subject: [PATCH] Add the session handler as a global twig variable, check for user session details in the skeleton --- app/src/Middlewares.php | 1 + app/templates/layouts/skeleton.twig | 2 +- docker-compose.override.yml.sample | 1 - docker-compose.yml | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/Middlewares.php b/app/src/Middlewares.php index f07fe9c..9501d25 100644 --- a/app/src/Middlewares.php +++ b/app/src/Middlewares.php @@ -48,6 +48,7 @@ class Middlewares $flash = $container->get(SessionInterface::class)->getFlash(); $twig->getEnvironment()->addGlobal('flash', $flash); + $twig->getEnvironment()->addGlobal('session', $container->get(SessionInterface::class)); $app->add(TwigMiddleware::create($app, $twig)); diff --git a/app/templates/layouts/skeleton.twig b/app/templates/layouts/skeleton.twig index e521b04..a61c076 100644 --- a/app/templates/layouts/skeleton.twig +++ b/app/templates/layouts/skeleton.twig @@ -19,7 +19,7 @@