flextype-components/notification

Notification component for storing and retrieving flash data.

v1.0.2 2019-02-05 19:16 UTC

This package is auto-updated.

Last update: 2024-11-06 11:09:08 UTC


README

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