2017 © Pedro Peláez
 

yii2-extension yii2-snotify

Snotify is extension implements at server-side notification to the user without client-side.

image

bupy7/yii2-snotify

Snotify is extension implements at server-side notification to the user without client-side.

  • Monday, February 8, 2016
  • by bupy7
  • Repository
  • 1 Watchers
  • 4 Stars
  • 47 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-snotify

Snotify is extension implements at server-side notification to the user without client-side., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist bupy7/yii2-snotify "*"

or add, (*4)

"bupy7/yii2-snotify": "*"

to the require section of your composer.json file., (*5)

Usage

Register module to modules section in config file:, (*6)

[
    'modules' => [
        ...

        'snotifymodule' => [
            'class' => 'bupy7\notify\ss\Module',
        ],

        ...
    ],
],

Add snotifymodule to bootstrap section in config file:, (*7)

[
    'bootstrap' => [
        ...

        'snotifymodule',

        ...
    ],
],

Register manager of snotify to components section in config file:, (*8)

[
    'components' => [
        ...

        'snotify' => [
            'class' => 'bupy7\notify\ss\components\Manager',
        ],

        ...
    ],
],

You can rename a component and a module how do you like., (*9)

Run migration:, (*10)

php ./yii migrate/up --migrationPath=@bupy7/notify/ss/migrations

Adding notification message:, (*11)

$userId = Yii::$app->user->id;
$body = 'Example of text message';
$title = 'Example of title message';
Yii::$app->snotify
    // success notify type
    ->addSuccess($userId, $body, $title)
    // danger notify type
    ->addDanger($userId, $body, $title)
    // info notify type
    ->addInfo($userId, $body, $title)
    // warning notify type
    ->addWarning($userid, $body, $title);

Profit! Your notification added to {{%notification}} table., (*12)

Configuration

Module:, (*13)

[
    'modules' => [
        ...

        'snotifymodule' => [
            'class' => 'bupy7\notify\ss\Module',
            'tableName' => '{{%notification}}', // table name with notification messages
            'db' => 'db', // database connection component config or name
        ],

        ...
    ],
],

License

yii2-snotify is released under the BSD 3-Clause License., (*14)

The Versions

08/02 2016

dev-master

9999999-dev

Snotify is extension implements at server-side notification to the user without client-side.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 module message notification notify server-side note