There is a problem configuring yii2 rbac and an internal error is reported.

WBOY
Release: 2023-03-01 15:40:02
Original
1191 people have browsed it

I get an error when configuring rbac of yii2. Configure according to the method provided at this address
http://www.manks.top/yii2_fra...

An error will be reported when configuring the urlManager item in main.php, as long as it is set

<code>"urlManager" => [
     // 'class' => 'yii\rbac\DbManager', //这里记得用单引号而不是双引号 
],</code>
Copy after login
Copy after login

An error will be reported here
There is a problem configuring yii2 rbac and an internal error is reported.

What exactly is going on?

Reply content:

I get an error when configuring rbac of yii2. Configure according to the method provided at this address
http://www.manks.top/yii2_fra...

An error will be reported when configuring the urlManager item in main.php, as long as it is set

<code>"urlManager" => [
     // 'class' => 'yii\rbac\DbManager', //这里记得用单引号而不是双引号 
],</code>
Copy after login
Copy after login

An error will be reported here
There is a problem configuring yii2 rbac and an internal error is reported.

What exactly is going on?

//Add the authManager component to the components array, there are two methods: PhpManager and DbManager,

<code>//PhpManager将权限关系保存在文件里,这里使用的是DbManager方式,将权限关系保存在数据库.    
"authManager" => [        
    "class" => 'yii\rbac\DbManager', //这里记得用单引号而不是双引号        
    "defaultRoles" => ["guest"],    
],   

人家是authManager</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template