Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

User Alert notifications.

Copyright: 2016 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 220 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

notification:: (8 methods):
  add()
  add_call_to_action()
  fetch()
  fetch_as_array()
  success()
  info()
  warning()
  error()


Class: notification  - X-Ref

add($message, $level = null)   X-Ref
Add a message to the session notification stack.

param: string $message The message to add to the stack
param: string $level   The type of message to add to the stack

add_call_to_action(array $icon, string $message, array $actions, string $region = '')   X-Ref

param: string[] $icon The icon to use. Required keys are 'pix' and 'component'.
param: string $message The message to display.
param: array $actions An array of action links
param: string $region Optional region name

fetch()   X-Ref
Fetch all of the notifications in the stack and clear the stack.

return: array All of the notifications in the stack

fetch_as_array(\renderer_base $renderer)   X-Ref
Fetch all of the notifications in the stack and clear the stack.

return: array All of the notifications in the stack

success($message)   X-Ref
Add a success message to the notification stack.

param: string $message The message to add to the stack

info($message)   X-Ref
Add a info message to the notification stack.

param: string $message The message to add to the stack

warning($message)   X-Ref
Add a warning message to the notification stack.

param: string $message The message to add to the stack

error($message)   X-Ref
Add a error message to the notification stack.

param: string $message The message to add to the stack