PHP code example of suver / yii2-users

1. Go to this page and download the library: Download suver/yii2-users 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/ */

    

suver / yii2-users example snippets


php composer.phar 

'bootstrap' => [
    'notifications',
],
'modules' => [
    'notifications' => [
        'class' => 'suver\behavior\notifications\Module',
        //      if you wont changed GridView or DataView classes
        //'dataViewWidget' => '\backend\widgets\DataView',
        //'gridViewWidget' => '\backend\widgets\GridView',
    ],
],
'components' => [
    'yii2-users' => [
        'class' => 'yii\rbac\DbManager',
    ],
];


'bootstrap' => [
    'notifications',
],
'modules' => [
        'notifications' => [
            'class' => 'suver\behavior\notifications\Module',
            'as access' => [
                'class' => 'yii\filters\AccessControl',
                'rules' => [
                    [
                        'controllers'=>['notifications/default'],
                        'allow' => true,
                        'roles' => ['@']                        
                    ],
                    [
                        'controllers'=>['notifications/list'],
                        'allow' => true,
                        'roles' => ['@']                        
                    ],
                    [
                        'controllers'=>['notifications/template'],
                        'allow' => true,
                        'roles' => ['@']                        
                    ],
                ]
            ]
        ],
    ],