0
我正在使用cakephp 2.6。如何在應用程序控制器中配置Auth組件
我遵循cakephp的食譜中的教程,發現在appcontroller中有兩種配置Auth組件的方法。
第一個是:
public $components = array(
'Acl',
'Auth' => array('authorize' => array('Actions' => array('actionPath' => 'controllers'))),
'Session'
);
,另一個是:
public $components = array(
'Acl',
'Auth' => array('authorize' => 'Controller'),
'Session'
);
所以我的問題是:什麼是它們之間的區別,以及爲什麼我們應該使用授權參數?
感謝期運用下面的代碼登錄功能,爲您的答案,但基本上我想知道爲什麼我應該使用**'authorize'=> array('Controller')的授權參數** –
你會在這裏找到你的答案。 http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#authorization –