Documentation

pm_View_Status
in package

Status messages helper

Tags
since
12.0

Table of Contents

STATUS_ERROR  = 'error'
STATUS_INFO  = 'info'
STATUS_WARNING  = 'warning'
__construct()  : mixed
addError()  : void
Add error message
addInfo()  : void
Add info message
addMessage()  : void
Add message
addWarning()  : void
Add warning message
getAllMessages()  : array<string|int, mixed>
Get all status messages and delete them if required
hasMessage()  : bool
Check if particular status message is present
hasMessagesByType()  : bool
Check if status message with certain type is present

Constants

STATUS_ERROR

public mixed STATUS_ERROR = 'error'

STATUS_INFO

public mixed STATUS_INFO = 'info'

STATUS_WARNING

public mixed STATUS_WARNING = 'warning'

Methods

__construct()

public __construct() : mixed
Return values
mixed

addError()

Add error message

public static addError(string $message[, bool $noEscape = false ]) : void
Parameters
$message : string
$noEscape : bool = false

if true, HTML is allowed in message

Return values
void

addInfo()

Add info message

public static addInfo(string $message[, bool $noEscape = false ]) : void
Parameters
$message : string
$noEscape : bool = false

if true, HTML is allowed in message

Return values
void

addMessage()

Add message

public static addMessage(string $status, string $message[, bool $noEscape = false ]) : void
Parameters
$status : string
$message : string
$noEscape : bool = false

if true, HTML is allowed in message

Return values
void

addWarning()

Add warning message

public static addWarning(string $message[, bool $noEscape = false ]) : void
Parameters
$message : string
$noEscape : bool = false

if true, HTML is allowed in message

Return values
void

getAllMessages()

Get all status messages and delete them if required

public static getAllMessages([bool $clearMessages = true ]) : array<string|int, mixed>
[
    [
        'status' => STATUS_INFO|STATUS_WARNING|STATUS_ERROR,
        'content' => string,
    ],
    ...
]
Parameters
$clearMessages : bool = true

[optional] Default is true.

Tags
since
17.0
Return values
array<string|int, mixed>

hasMessage()

Check if particular status message is present

public static hasMessage(string $message) : bool
Parameters
$message : string
Return values
bool

hasMessagesByType()

Check if status message with certain type is present

public static hasMessagesByType(string $type) : bool
Parameters
$type : string

Status message type, one of STATUS_INFO|STATUS_WARNING|STATUS_ERROR

Tags
since
17.0
Return values
bool

Search results