Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
FlashBag Class Reference

Bag for Session Flash messages Ubiquity\utils\flash$FlashBag This class is part of Ubiquity. More...

+ Inheritance diagram for FlashBag:

Public Member Functions

 __construct (bool $autoClear=true)
 
 addMessage (string $content, string $title=NULL, string $type='info', string $icon=null)
 Adds a temporary new message to the bag.
 
 addMessageAndSave (string $content, string $title=NULL, string $type='info', string $icon=null)
 Adds and saves a message in the bag.
 
 getMessages (string $type)
 Returns all the message of a type in the bag.
 
 getAll ()
 Returns all the messages.
 
 clear ()
 Clears the bag.
 
 rewind ()
 
 current ()
 
 key ()
 
 next ()
 
 valid ()
 
 save ()
 
 isAutoClear ()
 
 setAutoClear (bool $autoClear)
 

Data Fields

const FLASH_BAG_KEY = '_flash_bag'
 
const VAR_VIEW_NAME ='flashMessages'
 

Private Attributes

array $array
 
int $position = 0
 
bool $autoClear
 

Detailed Description

Bag for Session Flash messages Ubiquity\utils\flash$FlashBag This class is part of Ubiquity.

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.2

Definition at line 19 of file FlashBag.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( bool  $autoClear = true)

Definition at line 26 of file FlashBag.php.

Member Function Documentation

◆ addMessage()

addMessage ( string  $content,
string  $title = NULL,
string  $type = 'info',
string  $icon = null 
)

Adds a temporary new message to the bag.

Parameters
string$content
string | null$title
string$type
string | null$icon

Definition at line 46 of file FlashBag.php.

◆ addMessageAndSave()

addMessageAndSave ( string  $content,
string  $title = NULL,
string  $type = 'info',
string  $icon = null 
)

Adds and saves a message in the bag.

Parameters
string$content
string | null$title
string$type
string | null$icon

Definition at line 57 of file FlashBag.php.

◆ clear()

clear ( )

Clears the bag.

Definition at line 88 of file FlashBag.php.

◆ current()

current ( )
Returns
FlashMessage

Definition at line 101 of file FlashBag.php.

◆ getAll()

getAll ( )

Returns all the messages.

Returns
array

Definition at line 81 of file FlashBag.php.

◆ getMessages()

getMessages ( string  $type)

Returns all the message of a type in the bag.

Parameters
string$type
Returns
FlashMessage[]

Definition at line 67 of file FlashBag.php.

◆ isAutoClear()

isAutoClear ( )
Returns
bool

Definition at line 124 of file FlashBag.php.

◆ key()

key ( )

Definition at line 105 of file FlashBag.php.

◆ next()

next ( )

Definition at line 109 of file FlashBag.php.

◆ rewind()

rewind ( )

Definition at line 93 of file FlashBag.php.

◆ save()

save ( )

Definition at line 117 of file FlashBag.php.

◆ setAutoClear()

setAutoClear ( bool  $autoClear)
Parameters
bool$autoClear

Definition at line 131 of file FlashBag.php.

◆ valid()

valid ( )

Definition at line 113 of file FlashBag.php.

Field Documentation

◆ $array

array $array
private

Definition at line 22 of file FlashBag.php.

◆ $autoClear

bool $autoClear
private

Definition at line 24 of file FlashBag.php.

◆ $position

int $position = 0
private

Definition at line 23 of file FlashBag.php.

◆ FLASH_BAG_KEY

const FLASH_BAG_KEY = '_flash_bag'

Definition at line 20 of file FlashBag.php.

◆ VAR_VIEW_NAME

const VAR_VIEW_NAME ='flashMessages'

Definition at line 21 of file FlashBag.php.


The documentation for this class was generated from the following file: