From d69a1d917ee2cdb17f56d73480dd3e6ce7c5858d Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 17 Jan 2023 14:42:50 +0100 Subject: [PATCH] [Session] Adding `FlashBagInterface` Page: https://symfony.com/doc/5.4/session.html#flash-messages Info is taken from https://github.com/symfony/symfony/issues/39222#issuecomment-1210412275 --- session.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/session.rst b/session.rst index aa40cbb20e0..1d4131bd36e 100644 --- a/session.rst +++ b/session.rst @@ -249,6 +249,8 @@ needs. You can use the :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek` method instead to retrieve the message while keeping it in the bag. + Instead of doing ``$request->getSession()->getFlashBag()``, you can also inject the + ``Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface``. Configuration -------------