Return or manage messages recorded by just this object or all Wire objects
This method returns and manages messages that were previously set by Wire::message()
.
Example
// Get messages for one object
$messages = $obj->messages();
// Get first message in object
$message = $obj->messages('first');
// Get messages for all Wire objects
$messages = $obj->messages('all');
// Get and clear all messages for all Wire objects
$messages = $obj->messages('clear all');
Usage
// basic usage
$notices = $wire->messages();
// usage with all arguments
$notices = $wire->messages($options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
options (optional) | string, array | One or more of array elements or space separated string of:
|
Return value
Notices
array
string
Array of NoticeMessage
messages, or string if last, first or str option was specified.
API reference based on ProcessWire core version 3.0.236