Constants

INFO

INFO

SUCCESS

SUCCESS

WARNING

WARNING

ERROR

ERROR

TYPE

TYPE

Properties

$app

$app : 

Type

$hook

$hook : 

Type

$msgTypes

$msgTypes : 

Type

$msgWrapper

$msgWrapper : 

Type

$msgBefore

$msgBefore : 

Type

$msgAfter

$msgAfter : 

Type

$closeBtn

$closeBtn : 

Type

$stickyCssClass

$stickyCssClass : 

Type

$msgCssClass

$msgCssClass : 

Type

$cssClassMap

$cssClassMap : 

Type

$redirectUrl

$redirectUrl : 

Type

$msgId

$msgId : 

Type

Methods

__construct()

__construct() 

info()

info(string  $message, string  $redirectUrl = null, boolean  $sticky = false) : object

Add an info message

Parameters

string $message

The message text

string $redirectUrl

Where to redirect once the message is added

boolean $sticky

Sticky the message (hides the close button)

Returns

object

success()

success(string  $message, string  $redirectUrl = null, boolean  $sticky = false) : object

Add a success message

Parameters

string $message

The message text

string $redirectUrl

Where to redirect once the message is added

boolean $sticky

Sticky the message (hides the close button)

Returns

object

warning()

warning(string  $message, string  $redirectUrl = null, boolean  $sticky = false) : object

Add a warning message

Parameters

string $message

The message text

string $redirectUrl

Where to redirect once the message is added

boolean $sticky

Sticky the message (hides the close button)

Returns

object

error()

error(string  $message, string  $redirectUrl = null, boolean  $sticky = false) : object

Add an error message

Parameters

string $message

The message text

string $redirectUrl

Where to redirect once the message is added

boolean $sticky

Sticky the message (hides the close button)

Returns

object

sticky()

sticky(string  $message = true, string  $redirectUrl = null, string  $type = self::TYPE) : object

Add a sticky message

Parameters

string $message

The message text

string $redirectUrl

Where to redirect once the message is added

string $type

The $msgType

Returns

object

add()

add(string  $message, string  $type = self::TYPE, string  $redirectUrl = null, boolean  $sticky = false) : object

Add a flash message to the session data

Parameters

string $message

The message text

string $type

The $msgType

string $redirectUrl

Where to redirect once the message is added

boolean $sticky

Whether or not the message is stickied

Returns

object

showMessage()

showMessage() 

notice()

notice(  $num) 

Parameters

$num

display()

display(mixed  $types = null, boolean  $print = true) : string

Display the flash messages

Parameters

mixed $types

(null) print all of the message types (array) print the given message types (string) print a single message type

boolean $print

Whether to print the data or return it

Returns

string

hasErrors()

hasErrors() : boolean

See if there are any queued error messages

Returns

boolean

hasMessages()

hasMessages(string  $type = null) : boolean

See if there are any queued message

Parameters

string $type

The $msgType

Returns

boolean

setMsgWrapper()

setMsgWrapper(string  $msgWrapper = '') : object

Set the HTML that each message is wrapped in

Parameters

string $msgWrapper

The HTML that each message is wrapped in. Note: Two placeholders (%s) are expected. The first is the $msgCssClass, The second is the message text.

Returns

object

setMsgBefore()

setMsgBefore(string  $msgBefore = '') : object

Prepend string to the message (inside of the message wrapper)

Parameters

string $msgBefore

string to prepend to the message

Returns

object

setMsgAfter()

setMsgAfter(string  $msgAfter = '') : object

Append string to the message (inside of the message wrapper)

Parameters

string $msgAfter

string to append to the message

Returns

object

setCloseBtn()

setCloseBtn(string  $closeBtn = '') : object

Set the HTML for the close button

Parameters

string $closeBtn

HTML to use for the close button

Returns

object

setStickyCssClass()

setStickyCssClass(string  $stickyCssClass = '') : object

Set the CSS class for sticky notes

Parameters

string $stickyCssClass

the CSS class to use for sticky messages

Returns

object

setMsgCssClass()

setMsgCssClass(string  $msgCssClass = '') : object

Set the CSS class for messages

Parameters

string $msgCssClass

The CSS class to use for messages

Returns

object

setCssClassMap()

setCssClassMap(mixed  $msgType, mixed  $cssClass = null) : object

Set the CSS classes for message types

Parameters

mixed $msgType

(string) The message type (array) key/value pairs for the class map

mixed $cssClass

(string) the CSS class to use (null) not used when $msgType is an array

Returns

object

formatMessage()

formatMessage(array  $msgDataArray, string  $type) : string

Format a message

Parameters

array $msgDataArray

Array of message data

string $type

The $msgType

Returns

string —

The formatted message

doRedirect()

doRedirect() : object

Redirect the user if a URL was given

Returns

object

clear()

clear(mixed  $types = array()) : object

Clear the messages from the session data

Parameters

mixed $types

(array) Clear all of the message types in array (string) Only clear the one given message type

Returns

object