Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Renderable message to be displayed to the user. More...
Public Member Functions | |
__construct ($text=null, $type=self::TYPE_INFO) | |
get_action_label () | |
Returns action label. | |
get_action_url () | |
Returns action URL. | |
get_message () | |
Returns message text with HTML tags quoted. | |
get_type () | |
Returns message type. | |
set_action (moodle_url $url, $label) | |
Sets the optional message action. | |
set_text ($text) | |
Sets the message text. | |
set_type ($type=self::TYPE_INFO) | |
Sets the message type. | |
Public Attributes | |
const | TYPE_ERROR = 30 |
const | TYPE_INFO = 10 |
const | TYPE_OK = 20 |
Protected Attributes | |
string | $actionlabel = '' |
moodle_url | $actionurl = null |
string | $text = '' |
int | $type = self::TYPE_INFO |
Renderable message to be displayed to the user.
Message can contain an optional action link with a label that is supposed to be rendered as a button or a link.
workshop_message::__construct | ( | $text = null, | |
$type = self::TYPE_INFO ) |
string | $text | short text to be displayed |
string | $type | optional message type info|ok|error |
workshop_message::get_action_label | ( | ) |
Returns action label.
string |
workshop_message::get_action_url | ( | ) |
Returns action URL.
moodle_url|null |
workshop_message::get_message | ( | ) |
Returns message text with HTML tags quoted.
string |
workshop_message::get_type | ( | ) |
Returns message type.
int |
workshop_message::set_action | ( | moodle_url | $url, |
$label ) |
Sets the optional message action.
moodle_url | $url | to follow on action |
string | $label | action label |
workshop_message::set_text | ( | $text | ) |
Sets the message text.
string | $text | short text to be displayed |
workshop_message::set_type | ( | $type = self::TYPE_INFO | ) |
Sets the message type.
int | $type |