Simple but useful JS notification script with PHP Api.

Installs: 912

Dependents: 3

Suggesters: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0


1.0.0 2018-07-03 10:50 UTC


Latest Stable Version Latest Unstable Version Total Downloads License

This simple extension helps to show nice notifications in browser. It uses FontAwesome icons and can be customised by overwriting base CSS styles.



Just run:

$ composer require floor12/yii2-notification

or add this to the require section of your composer.json.

"floor12/yii2-notification": "dev-master"

To use javascript way, add floor12\notification\NotificationAsset in your app.

In case if using PHP api, NotificationAsset will be included in your app by Notification class.


Show notification by run JS function info(text,type) with text and one of this types:

  • 0 - information;
  • 1 - success;
  • 2 - error;

For example:

if (success == true)
    info('Model  saved',1);    
    info('Something wrong here',2);

Its also possible to show notifications by calling PHP API:

use floor12\notification\Notification;

Notification::info('The form is loading...');
Notification::error('Pleas fill all required fields');
Notification::success('This model is saved');