Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Static Public Member Functions | Public Attributes | List of all members
core\notification Class Reference

Static Public Member Functions

static add ($message, $level=null)
 Add a message to the session notification stack. More...
 
static add_call_to_action (array $icon, string $message, array $actions, string $region='')
 
static error ($message)
 Add a error message to the notification stack. More...
 
static fetch ()
 Fetch all of the notifications in the stack and clear the stack. More...
 
static fetch_as_array (\renderer_base $renderer)
 Fetch all of the notifications in the stack and clear the stack. More...
 
static info ($message)
 Add a info message to the notification stack. More...
 
static success ($message)
 Add a success message to the notification stack. More...
 
static warning ($message)
 Add a warning message to the notification stack. More...
 

Public Attributes

const ERROR = 'error'
 A notification of level 'error'.
 
const INFO = 'info'
 A notification of level 'info'.
 
const SUCCESS = 'success'
 A notification of level 'success'.
 
const WARNING = 'warning'
 A notification of level 'warning'.
 

Member Function Documentation

◆ add()

static core\notification::add (   $message,
  $level = null 
)
static

Add a message to the session notification stack.

Parameters
string$messageThe message to add to the stack
string$levelThe type of message to add to the stack

◆ add_call_to_action()

static core\notification::add_call_to_action ( array  $icon,
string  $message,
array  $actions,
string  $region = '' 
)
static
Parameters
string[]$iconThe icon to use. Required keys are 'pix' and 'component'.
string$messageThe message to display.
array$actionsAn array of action links
string$regionOptional region name
Exceptions
coding_exception

◆ error()

static core\notification::error (   $message)
static

Add a error message to the notification stack.

Parameters
string$messageThe message to add to the stack

◆ fetch()

static core\notification::fetch ( )
static

Fetch all of the notifications in the stack and clear the stack.

Return values
arrayAll of the notifications in the stack

◆ fetch_as_array()

static core\notification::fetch_as_array ( \renderer_base  $renderer)
static

Fetch all of the notifications in the stack and clear the stack.

Return values
arrayAll of the notifications in the stack

◆ info()

static core\notification::info (   $message)
static

Add a info message to the notification stack.

Parameters
string$messageThe message to add to the stack

◆ success()

static core\notification::success (   $message)
static

Add a success message to the notification stack.

Parameters
string$messageThe message to add to the stack

◆ warning()

static core\notification::warning (   $message)
static

Add a warning message to the notification stack.

Parameters
string$messageThe message to add to the stack

The documentation for this class was generated from the following file: