multiple RBAC YII2 admin with mdmsoft

‘adminsatu’ => [
‘defaultRoute’ => ‘assignment’,
‘class’ => ‘mdm\admin\Module’,
‘layout’ => ‘left-menu’, // it can be ‘@path/to/your/layout’.
‘mainLayout’ => ‘@app/views/layouts/main.php’,
‘controllerMap’ => [
‘assignment’ => [
‘class’ => ‘mdm\admin\controllers\AssignmentController’,
‘userClassName’ => ‘app\models\Usersatu’,
‘idField’ => ‘user_id’
],
],

‘menus’ => [
‘assignment’ => [
‘label’ => ‘Grand Access’ // change label
],
‘route’ => null, // disable menu route
]
],
‘admindua’ => [
‘defaultRoute’ => ‘assignment’,
‘class’ => ‘mdm\admin\Module’,
‘layout’ => ‘left-menu’, // it can be ‘@path/to/your/layout’.
‘mainLayout’ => ‘@app/views/layouts/main.php’,
‘controllerMap’ => [
‘assignment’ => [
‘class’ => ‘mdm\admin\controllers\AssignmentController’,
‘userClassName’ => ‘app\models\userdua’,
‘idField’ => ‘user_id’
],
],’menus’ => [
‘assignment’ => [
‘label’ => ‘Grand Access’ // change label
],
‘route’ => null, // disable menu route
]
],


Jadi anda bisa define dua module ini secara bersamaan dengan dua nama berbeda dengan dua model berbeda

jadi anda dapat mengaksesnya via http://localhost/namaproject/adminsatu atau http://localhost/namaproject/index.php?r=admindua ( anda harus enable pretty urlnya terlebih dahulu ) atau http://localhost/namaproject/index.php?r=adminsatu  atau http://localhost/namaproject/index.php?r=admindua

Leave a Reply

© 2021 IT & Photography blog | WordPress Theme : ScrollMe