File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -376,6 +376,18 @@ Stored attributes remain in the session for the remainder of that user's session
376376 Every ``SessionInterface `` implementation is supported. If you have your
377377 own implementation, type-hint this in the arguments instead.
378378
379+ As a developer, you might prefer not to extend the ``Controller ``. To use the
380+ flash message functionality, you can request the flash bag from the
381+ :class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Session `::
382+
383+ use Symfony\Component\HttpFoundation\Session\Session;
384+
385+ public function indexAction(Session $session)
386+ {
387+ // getFlashBag is not available in the SessionInterface and requires the Session
388+ $flashBag = $session->getFlashBag();
389+ }
390+
379391.. index ::
380392 single: Session; Flash messages
381393
You can’t perform that action at this time.
0 commit comments