在這裏我的控制器名稱是AucUsersController。使用auth組件後,它找到userscontroller.I想要更改此目錄。我已經嘗試了以下代碼,但它不起作用。如何更改cakephp auth組件控制器?
public $components = array('Paginator'=>array('limit'=>2),'Auth'=>array(
'Controller'=>'AucUsers',
'loginRedirect' => array('controller' => 'aucusers','action' => 'index'),
'logoutRedirect' => array('controller' => 'aucusers','action' => 'index'),
'authError'=>'You can not access this page!!',
));
如何更改此默認控制器?
您是否從文檔閱讀本http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#creating-custom-authorize -objects;您不創建控制器。您創建AppController的一個驗證組件 – gmponos 2014-10-29 09:57:59
後添加AUTH組件,默認情況下搜索在userscontroller.But登錄動作在這裏我使用AucUsersController,所以沒有任何UsersController.After在AppController中添加驗證組件現在它的搜索一個userscontroller.But我沒有任何用戶控制器。 – 2014-10-29 10:02:45
對不起。我以爲你想製作自己的認證組件。 – gmponos 2014-10-29 10:18:14