2017 © Pedro Peláez
 

library yii2-notification

Simple but useful JS notification script with PHP Api.

image

floor12/yii2-notification

Simple but useful JS notification script with PHP Api.

  • Tuesday, July 3, 2018
  • by floor12
  • Repository
  • 1 Watchers
  • 0 Stars
  • 131 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

yii2-notification

Latest Stable Version Scrutinizer Code Quality Latest Unstable Version Total Downloads License, (*1)

Этот файл так же доступен на русском языке., (*2)

This simple extension helps to show nice notifications in browser. It use svg icons and can be customised by overwriting base CSS styles., (*3)

Image, (*4)

Installation

Just run:, (*5)

$ composer require floor12/yii2-notification

or add this to the require section of your composer.json., (*6)

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

To include js and css files, add floor12\notification\NotificationAsset as dependency in your AppAsset:, (*7)

use floor12\notification\NotificationAsset;
use yii\web\AssetBundle;

class AppAsset extends AssetBundle
{
    ...
    public $depends = [
        NotificationAsset::class
    ];
}

Using as JS

To show notification in browser just pass message text to one of the f12notification object methods:, (*8)

f12notification.info(text);    //information message;
f12notification.success(text); //success message;
f12notification.error(text);   //error message;

For example:, (*9)

if (userSucces == true)
  f12notification.success('Registration success'.)
else
  f12notification.error('Registration failed.')

Using as PHP

Its also possible to show notifications by passing message text to one of the floor12\notification\Notification methods:, (*10)

use floor12\notification\Notification;

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

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

The Versions

03/07 2018

dev-master

9999999-dev

Simple but useful JS notification script with PHP Api.

  Sources   Download

MIT

The Requires

 

by Avatar floor12

notification notify

03/07 2018

1.0.0

1.0.0.0

Simple but useful JS notification script with PHP Api.

  Sources   Download

MIT

The Requires

 

by Avatar floor12

notification notify

27/06 2018

v0.1.0

0.1.0.0

Simple but useful JS notification script with PHP Api.

  Sources   Download

MIT

The Requires

 

by Avatar floor12

notification notify