\pm_View_Status

Status messages helper

Summary

Methods
Properties
Constants
__construct()
addInfo()
addWarning()
addError()
addMessage()
hasMessage()
getAllMessages()
hasMessagesByType()
No public properties found
STATUS_INFO
STATUS_WARNING
STATUS_ERROR
No protected methods found
No protected properties found
N/A

Constants

STATUS_INFO

STATUS_INFO

STATUS_WARNING

STATUS_WARNING

STATUS_ERROR

STATUS_ERROR

Properties

Methods

__construct()

__construct() 

addInfo()

addInfo(string  $message, boolean  $noEscape = false) 

Add info message

Parameters

string $message
boolean $noEscape

if true, HTML is allowed in message

addWarning()

addWarning(string  $message, boolean  $noEscape = false) 

Add warning message

Parameters

string $message
boolean $noEscape

if true, HTML is allowed in message

addError()

addError(string  $message, boolean  $noEscape = false) 

Add error message

Parameters

string $message
boolean $noEscape

if true, HTML is allowed in message

addMessage()

addMessage(string  $status, string  $message, boolean  $noEscape = false) 

Add message

Parameters

string $status
string $message
boolean $noEscape

if true, HTML is allowed in message

hasMessage()

hasMessage(string  $message) : boolean

Check if particular status message is present

Parameters

string $message

Returns

boolean

getAllMessages()

getAllMessages(boolean  $clearMessages = true) : array

Get all status messages and delete them if required

[
    [
        'status' => STATUS_INFO|STATUS_WARNING|STATUS_ERROR,
        'content' => string,
    ],
    ...
]

Parameters

boolean $clearMessages

[optional] Default is true.

Returns

array

hasMessagesByType()

hasMessagesByType(string  $type) : boolean

Check if status message with certain type is present

Parameters

string $type

Status message type, one of STATUS_INFO|STATUS_WARNING|STATUS_ERROR

Returns

boolean