SessionFlashBag
final class SessionFlashBag implements FlashBagInterface (View source)
Stores flash values in one normalized namespace of the current session
Constants
| private NAMESPACE_NAME |
|
Methods
Connects the bag to the session that persists its transient values
Stores or replaces a flash value in the dedicated session namespace
Returns a flash value while leaving it available for later reads
Checks the normalized flash namespace for the key
Removes a flash value without returning it
Returns a flash value and removes it during the current request.
Returns all normalized flash values without mutating the bag
Removes the complete flash namespace from the session
Details
__construct
__construct(SessionInterface $session)
Connects the bag to the session that persists its transient values
set
void
set(string $key, mixed $value)
Stores or replaces a flash value in the dedicated session namespace
get
mixed
get(string $key, mixed $default = null)
Returns a flash value while leaving it available for later reads
has
bool
has(string $key)
Checks the normalized flash namespace for the key
remove
void
remove(string $key)
Removes a flash value without returning it
pull
mixed
pull(string $key, mixed $default = null)
Returns a flash value and removes it during the current request.
all
array
all()
Returns all normalized flash values without mutating the bag
clear
void
clear()
Removes the complete flash namespace from the session