\Symfony\Component\HttpFoundation\Session\FlashFlashBagInterface

FlashBagInterface.

Summary

Methods
Constants
getName()
initialize()
getStorageKey()
clear()
add()
set()
peek()
peekAll()
get()
all()
setAll()
has()
keys()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getName()

getName() : string

Gets this bag's name.

Returns

string —

initialize()

initialize(array  $array) : mixed

Initializes the Bag.

Parameters

array $array

Returns

mixed —

getStorageKey()

getStorageKey() : string

Gets the storage key for this bag.

Returns

string —

clear()

clear() : mixed

Clears out data from bag.

Returns

mixed —

Whatever data was contained

add()

add(string  $type, mixed  $message) : mixed

Adds a flash message for the given type.

Parameters

string $type
mixed $message

Returns

mixed —

set()

set(string  $type, string|array  $messages) : mixed

Registers one or more messages for a given type.

Parameters

string $type
string|array $messages

Returns

mixed —

peek()

peek(string  $type, array  $default = []) : array

Gets flash messages for a given type.

Parameters

string $type

Message category type

array $default

Default value if $type does not exist

Returns

array —

peekAll()

peekAll() : array

Gets all flash messages.

Returns

array —

get()

get(string  $type, array  $default = []) : array

Gets and clears flash from the stack.

Parameters

string $type
array $default

Default value if $type does not exist

Returns

array —

all()

all() : array

Gets and clears flashes from the stack.

Returns

array —

setAll()

setAll(array  $messages) : mixed

Sets all flash messages.

Parameters

array $messages

Returns

mixed —

has()

has(string  $type) : bool

Has flash messages for a given type?

Parameters

string $type

Returns

bool —

keys()

keys() : array

Returns a list of all defined types.

Returns

array —