diff --git a/app/src/Middlewares.php b/app/src/Middlewares.php index 4499cc6..f11eea0 100644 --- a/app/src/Middlewares.php +++ b/app/src/Middlewares.php @@ -49,7 +49,6 @@ class Middlewares /** @var SessionInterface $session */ $session = $container->get(SessionInterface::class); $twig->getEnvironment()->addGlobal('session', $session); - $twig->getEnvironment()->addGlobal('flash', $session->getFlash()); $app->add(TwigMiddleware::create($app, $twig)); diff --git a/app/templates/layouts/components/flash.twig b/app/templates/layouts/components/flash.twig index b5ea5e6..e09828a 100644 --- a/app/templates/layouts/components/flash.twig +++ b/app/templates/layouts/components/flash.twig @@ -1,5 +1,7 @@ -{% for level, message in flash.all() %} +{% for level, messages in session.getFlash().all() %} {% endfor %}