2017 © Pedro Peláez
 

yii2-extension yii2-noifications

Yii2 notifications module

image

fgh151/yii2-noifications

Yii2 notifications module

  • Monday, May 23, 2016
  • by fgh151
  • Repository
  • 1 Watchers
  • 0 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 19 % Grown

The README.md

Yii2 notifications module

Yii2 notifications module, (*1)

This module provide functions to send notifications to user. Implements admin part where you can wie messages and create item. In frontend messages will be in bootstrap alert box, By the timer widget ask backend for new messages and show them., (*2)

Installation

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

Either run, (*4)

php composer.phar require --prefer-dist fgh151/yii2-noifications "*"

or add, (*5)

"fgh151/yii2-noifications": "*"

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

Usage

Once the extension is installed, simply use it in your code to config :, (*7)

'modules' => [
        ...
        'notification' => [
            'class' => 'fgh151\notifications\Module'
        ]
    ]

then include widget on pages where module will be:, (*8)

echo fgh151\notifications\widgets\notifications\Widget::widget();

API

You can direct create message, for example:, (*9)

$notify = new fgh151\notifications\models\Notification();
$notify->Message = $message;
$notify->UserId = $user;
$notify->Type = $type;
$notify->save();

or you can use method send:, (*10)

fgh151\notifications\models\Notification::send('info', 'Info message' , 127);

where first argument - type of bootstrap message, second - message text, third - receiver user id, also you can send array of users, for example:, (*11)

fgh151\notifications\models\Notification::send('info', 'Info message' , [1,2,3,4,5]);

The Versions

23/05 2016

dev-master

9999999-dev

Yii2 notifications module

  Sources   Download

MIT

The Requires

 

extension yii2 notify

23/05 2016

v0.0.1

0.0.1.0

Yii2 notifications module

  Sources   Download

MIT

The Requires

 

extension yii2 notify