1. Go to this page and download the library: Download izyue/yii2-admin 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/ */
return [
'modules' => [
'admin' => [
'class' => 'izyue\admin\Module',
...
]
...
],
...
'components' => [
...
'authManager' => [
'class' => 'yii\rbac\PhpManager', // or use 'yii\rbac\DbManager'
]
],
'as access' => [
'class' => 'izyue\admin\components\AccessControl',
'allowActions' => [
'site/*',
'admin/*',
'some-controller/some-action',
// The actions listed here will be allowed to everyone including guests.
// So, 'admin/*' should not appear here in the production, of course.
// But in the earlier stages of your development, you may probably want to
// add a lot of actions here until you finally completed setting up rbac,
// otherwise you may not even take a first step.
]
],
];
'modules' => [
'admin' => [
...
'layout' => 'left-menu', // defaults to null, using the application's layout without the menu
// other avaliable values are 'right-menu' and 'top-menu'
],
...
],