PHP code example of fgh151 / yii2-noifications

1. Go to this page and download the library: Download fgh151/yii2-noifications library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fgh151 / yii2-noifications example snippets


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

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

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

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

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

php composer.phar