cakephp中的视图/用户中缺少注销页面
我正在使用cakephp,当单击logout按钮时,url会转到其他地址,视图/用户中没有logout.ctp,因此任何人都可以告诉我logout.ctp页面的编码 您不需要logout.ctp视图,只需检查注销后重定向用户的位置即可 这个怎么样: UsersController.php AppController.phpcakephp中的视图/用户中缺少注销页面,cakephp,model-view-controller,Cakephp,Model View Controller,我正在使用cakephp,当单击logout按钮时,url会转到其他地址,视图/用户中没有logout.ctp,因此任何人都可以告诉我logout.ctp页面的编码 您不需要logout.ctp视图,只需检查注销后重定向用户的位置即可 这个怎么样: UsersController.php AppController.php 请在UsersController中发布注销操作的代码您是否在UsersController中创建了任何注销方法?函数logout{$this->Session->destr
请在UsersController中发布注销操作的代码您是否在UsersController中创建了任何注销方法?函数logout{$this->Session->destroy;$this->redirect$this->Auth->logout;}公共函数google\u logout{$this->Session->destroy;$this->Session->delete'Glogin';header'Location:;$this->redirect$this->Auth->logout;}非常感谢我收到了我的错误,现在如果我在数据库中有一些数据,搜索结果是空白页……为什么
public function logout() {
$this->Session->destroy();
return $this->redirect($this->Auth->logout());
}
class AppController extends Controller
{
public function initialize()
{
parent::initialize();
$this->loadComponent('Auth', array(
'authenticate' => array(
'Form' => array('fields' => array('username' => 'email', 'password' => 'password'))
),
//Controller and Action where you want redirect users after login
'loginRedirect' => array(
'controller' => 'Users',
'action' => 'index'
),
//Controller and Action where you want redirect users after logout
'logoutRedirect' => array(
'controller' => 'Pages',
'action' => 'home',
),
));
}