interface FlashBagInterface (View source)

Provides keyed transient values stored inside the current session

Methods

void
set(string $key, mixed $value)

Stores a transient value under the key

void
mixed
get(string $key, mixed $default = null)

Returns a transient value without removing it

mixed
bool
has(string $key)

Checks whether a transient value exists for the key

bool
void
remove(string $key)

Removes a transient value without returning it

void
mixed
pull(string $key, mixed $default = null)

Returns a transient value and removes it from the bag

mixed
array
all()

Returns all transient values keyed by their session names

array
void
clear()

Removes every transient value from the current session

void

Details

set

void set(string $key, mixed $value)

Stores a transient value under the key

Parameters

string $key
mixed $value

Return Value

void

get

mixed get(string $key, mixed $default = null)

Returns a transient value without removing it

Parameters

string $key
mixed $default

Return Value

mixed

has

bool has(string $key)

Checks whether a transient value exists for the key

Parameters

string $key

Return Value

bool

remove

void remove(string $key)

Removes a transient value without returning it

Parameters

string $key

Return Value

void

pull

mixed pull(string $key, mixed $default = null)

Returns a transient value and removes it from the bag

Parameters

string $key
mixed $default

Return Value

mixed

all

array all()

Returns all transient values keyed by their session names

Return Value

array

clear

void clear()

Removes every transient value from the current session

Return Value

void