Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
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 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

◆ 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: