PHP code example of macfly / yii2-rbac-cli

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

    

macfly / yii2-rbac-cli example snippets


  'modules' => [
     ................
    'rbac'  => [
      'class'       => 'macfly\rbac\Module',
    ],
    ................
  ],
sh
php composer.phar 
sh
php yii rbac/load/yaml /tmp/role.yml
sh
php yii rbac/load/add userid permissionOrRoleName
sh
php yii rbac/load/add 1 view