bariew / yii2-rbac-cms-module

Rbac db module for cms.
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

As use this shit? #1

Open xfg opened 9 years ago

xfg commented 9 years ago

I have made as written in a readme file, but this bullshit not working.

  1. Go to rbac/auth-item/index URL and create some roles and permissions, using menu tree with right mouse button.

get -> index.php?r=rbac/auth-item/index -> result -> Not Found (#404)

bariew commented 9 years ago

Hey! You are right. I've got to update docs - there is missing part about attaching module and setting router. Are you common with Yii anyway? I believe I could miss few other things necessary for any module installation. Your feedback is very important, I think, I can write an article about module installing and insert a link to it in README files. I'll try to describe it shortly below.

INSTALLING MODULE.

  1. Define module in your main config file:
'modules' => [
    ...
    'rbac' => 'bariew\rbacModule\Module',
]
  1. Make module controllers available in you router. It is urlManager settings block in your main config. Here's my config for any module.
'components' => [
    ...
        'urlManager' => [
            'enablePrettyUrl'       => true,
            'showScriptName'        => false,
            'enableStrictParsing'   => true,
            'rules' => [
                '<_a>'    => 'site/<_a>',
                '<_c>/<_a>'=>'<_c>/<_a>',
                '<_m>/<_c>/<_a>' => '<_m>/<_c>/<_a>',
                '/'                 => 'site/index',
            ],
        ],
],

That's all. Please notify me if I missed something!