Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Session] "getFlashBag" interfacing issue #11279

Copy link
Copy link
Closed
@linaori

Description

@linaori
Issue body actions

When you want the FlashBag to set a message, you'd like to do getFlashBag on the session. However, you can only achieve this by type hinting an injection on the Session\Session object. The Session\SessionInterface doesn't contain the "getFlashBag" method thus you can't use the Request::getSession();

If you do want to get the flash bag from it, you can try "getSession()->getBag('flash bag name')". However, that doesn't guarantee that you get the flash bag that was inserted because you don't know the name.

It's a minor inconvenience that has multiple custom solutions, but I've seen this issue come around a couple of times already in "#symfony".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.