如何在使用cakedc用户插件时在cakephp中进行loginredirect,并告诉这些更改在何处进行src/controller/AppController或vendor/cakedc/users/src/Controller/AppController
AppContoller of cakedc users plugin
class AppController extends BaseController
{
public function initialize()
{
parent::initialize();
$this->loadComponent('Security');
$this->loadComponent('Csrf');
$this->loadComponent('CakeDC/Users.UsersAuth', ['loginAction' => ['controller' => 'Blogs','action' => 'index']]);
}
}发布于 2017-01-19 13:08:23
在加载插件之后,可以更新Auth组件配置中的默认值,如下所示:
$this->Auth->config('loginAction', [...your url...]);或者您也可以按照这里的建议使用基于配置的插件初始化( https://github.com/CakeDC/users/blob/master/Docs/Documentation/Configuration.md )。
https://stackoverflow.com/questions/41742337
复制相似问题