CoreAlert

Filepath: phork/php/core/CoreAlert.class.php

The CoreAlert class collects and returns alerts triggered from the various modules. In addition to the standard alerts, which persist only until the end of the request, there are also sticky alerts which persist in the session until they've been retrieved by the getAlerts() method. These are also known as flash messages.

The alerts are displayed in the alert node in CoreController, however if that node is excluded or CoreControllerLite is used then the alerts have to be displayed manually.

The alert class is a singleton meaning there can only be one instance of it at a time.


Example

//trigger a standard alert
CoreAlert::alert('This is an alert');

//trigger a sticky alert
CoreAlert::alert('This is a sticky alert', true);

//retrieve the alerts
$arrAlerts = CoreAlert::getAlerts();