/notification

Notification component for storing and retrieving flash data.

Primary LanguagePHPMIT LicenseMIT

Notification Component

Version MIT License Quality Score

Notification component for storing and retrieving flash data.

Installation

composer require flextype-components/notification

Usage

use Flextype\Component\Notification\Notification;

Initializes the Notification service.
This will read notification/flash data from the $_SESSION variable and load it into the $this->previous array.

Notification::init();

Returns a specific variable from the Notifications array.

echo Notification::get('success');
echo Notification::get('errors');

Adds specific variable to the Notifications array.

Notification::set('success', 'Data has been saved with success!');
Notification::set('errors', 'Data not saved!');

Adds specific variable to the Notifications array for current page.

Notification::setNow('success', 'Success!');

Clears the Notifications array.
Data that previous pages stored will not be deleted, just the data that this page stored itself.

Notification::clean();

License

See LICENSE