Php Zend Framework重定向器帮助器路由
所以我有这个问题两天了,直到现在我还不能解决。基本上,我根据Rob Allen的教程创建了一个简单的登录,并根据我的环境进行了一些调整。在该教程中,当用户进行身份验证时,登录页面重定向到Zend索引页面。现在我想在位于views/scripts/auth的success.phtml页面中重定向它。代码如下:Php Zend Framework重定向器帮助器路由,php,redirect,zend-framework,routes,Php,Redirect,Zend Framework,Routes,所以我有这个问题两天了,直到现在我还不能解决。基本上,我根据Rob Allen的教程创建了一个简单的登录,并根据我的环境进行了一些调整。在该教程中,当用户进行身份验证时,登录页面重定向到Zend索引页面。现在我想在位于views/scripts/auth的success.phtml页面中重定向它。代码如下: public function indexAction() { $form = new Application_Form_Login(); $request = $this-
public function indexAction() {
$form = new Application_Form_Login();
$request = $this->getRequest();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
if ($this->_process($form->getValues())) {
// We're authenticated! Redirect to the home page
$this->_helper->redirector('success', 'auth');
}
}
}
$this->view->form = $form;
}
public function successAction(){
$this->_redirector->gotoUrl('/auth/success');
return;
}
在我添加successAction函数之前,页面显示错误,因为没有创建所述函数。但现在,它显示了导致重定向过多的页面未找到。Zend的重定向究竟是如何工作的?感谢您的帮助。我得到了答案,只是空的成功方法…我得到了答案,只是空的成功方法。。。