class FlashBag implements FlashBagInterface
FlashBag flash message container.
__construct(string $storageKey = '_symfony_flashes') | ||
string | getName() Gets this bag's name. | |
setName($name) | ||
initialize(array $flashes) Initializes the Bag. | ||
add(string $type, mixed $message) Adds a flash message for type. | ||
array | peek(string $type, array $default = array()) Gets flash messages for a given type. | |
array | peekAll() Gets all flash messages. | |
array | get(string $type, array $default = array()) Gets and clears flash from the stack. | |
array | all() Gets and clears flashes from the stack. | |
set(string $type, $messages) Registers a message for a given type. | ||
setAll(array $messages) Sets all flash messages. | ||
bool | has(string $type) Has flash messages for a given type? | |
array | keys() Returns a list of all defined types. | |
string | getStorageKey() Gets the storage key for this bag. | |
mixed | clear() Clears out data from bag. |
string | $storageKey | The key used to store flashes in the session |
Gets this bag's name.
string |
$name |
Initializes the Bag.
array | $flashes |
Adds a flash message for type.
string | $type | |
mixed | $message |
Gets flash messages for a given type.
string | $type | Message category type |
array | $default | Default value if $type does not exist |
array |
Gets all flash messages.
array |
Gets and clears flash from the stack.
string | $type | |
array | $default | Default value if $type does not exist |
array |
Gets and clears flashes from the stack.
array |
Registers a message for a given type.
string | $type | |
$messages |
Sets all flash messages.
array | $messages |
Has flash messages for a given type?
string | $type |
bool |
Returns a list of all defined types.
array |
Gets the storage key for this bag.
string |
Clears out data from bag.
mixed | Whatever data was contained |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.html