Home  >  Article  >  Backend Development  >  There is a problem configuring yii2 rbac and an internal error is reported.

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

WBOY
WBOYOriginal
2016-12-01 00:25:231145browse

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>

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>

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>
Statement:
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