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()  : mixed
Add error message
addInfo()  : mixed
Add info message
addMessage()  : mixed
Add message
addWarning()  : mixed
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 ]) : mixed
Parameters
$message : string
$noEscape : bool = false

if true, HTML is allowed in message

Return values
mixed

addInfo()

Add info message

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

if true, HTML is allowed in message

Return values
mixed

addMessage()

Add message

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

if true, HTML is allowed in message

Return values
mixed

addWarning()

Add warning message

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

if true, HTML is allowed in message

Return values
mixed

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