2016-03-01 68 views
0

我使用CakePHP 3和TinyAuth插件進行授權。TinyAuth:未找到授權適配器「TinyAuth.Tiny」

在CakePHP的3.0與作曲家安裝TinyAuth,並使其能夠在AppController中,當我嘗試登錄我碰到下面的錯誤後:

Authorization adapter "TinyAuth.Tiny" was not found

這是我initalize它的AppController:

'authorize' => [ 
        'TinyAuth.Tiny' => [ 
         'roleColumn' => 'role_id', 
         'rolesTable' => 'Roles', 
         'multiRole' => true, 
         'pivotTable' => 'roles_users', 
         'superAdminRole' => null, 
         'authorizeByPrefix' => false, 
         'prefixes' => [], 
         'allowUser' => false, 
         'adminPrefix' => null, 
         'autoClearCache' => true 
        ] 

我加載它在bootstrap.php中,像這樣:

Plugin::load('TinyAuth', []); 

回答

1

在開機strap.php嘗試:

Plugin::load('TinyAuth'); 

Plugin::load('TinyAuth', ['autoload' => true]); 

Load plugins in cakephp 3

+0

'插件::負載( 'TinyAuth',[ '自動加載'=>真]);' 那是什麼我需要,謝謝! –