yii2应用配置位置路径
yii2 application configuration location path
我想将这段代码添加到应用程序配置中,我是从这里得到的 link.
return [
'modules' => [
'admin' => [
'class' => 'mdm\admin\Module',
...
]
...
],
...
'components' => [
...
'authManager' => [
'class' => 'yii\rbac\PhpManager', // or use 'yii\rbac\DbManager'
]
],
'as access' => [
'class' => 'mdm\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.
]
],];
但是那个文件在哪里?
我正在使用 Yii2 高级模板。
您必须将此添加到位于后端和前端(取决于您的要求)的配置主文件中。
在后端
Path : backend/config/main.php
在前端
Path : frontend/config/main.php
您必须在各个组件中添加所有配置设置
我想将这段代码添加到应用程序配置中,我是从这里得到的 link.
return [
'modules' => [
'admin' => [
'class' => 'mdm\admin\Module',
...
]
...
],
...
'components' => [
...
'authManager' => [
'class' => 'yii\rbac\PhpManager', // or use 'yii\rbac\DbManager'
]
],
'as access' => [
'class' => 'mdm\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.
]
],];
但是那个文件在哪里? 我正在使用 Yii2 高级模板。
您必须将此添加到位于后端和前端(取决于您的要求)的配置主文件中。
在后端
Path : backend/config/main.php
在前端
Path : frontend/config/main.php
您必须在各个组件中添加所有配置设置