Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 1.22 KB

README.md

File metadata and controls

61 lines (46 loc) · 1.22 KB

Yii2 RBAC Rule Generator Extension


An extension for generataring rule classes via gii.

Installation

The preferred way to install this extension is through composer:

Either run

php composer.phar require --prefer-dist r2am9d/yii2-rbac-rule

or add

"r2am9d/yii2-rbac-rule": "*"

to the require-dev section of your composer.json file.

Usage

Once the extension is installed, simply modify your application configuration as follows:

return [
    'bootstrap' => ['gii'],
    'modules' => [
        'gii' => [
            'class' => 'yii\gii\Module',
            'generators' => [
                'rule' => [
                    'class' => 'r2am9d\rule\gii\Generator'
                ]
            ]
        ],
    ],
];

You can then access the generator through the following URL:

http://localhost/path/to/index?r=gii/rule

or if you have enabled pretty URLs, you may use the following URL:

http://localhost/path/to/index/gii/rule