【发布时间】:2010-12-23 07:32:36
【问题描述】:
我想知道是否可以在没有重定向的情况下使用 flash messenger?例如。登录失败后,我想继续显示表单,不需要重定向。
public function loginAction() {
$form = new Application_Form_Login();
...
if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getParams())) {
$authAdapter = new Application_Auth_Adapter($form->getValue('username'), $form->getValue('password'));
if ($this->auth->authenticate($authAdapter)->isValid()) {
...
} else {
// login failed
$this->flashMessenger->addMessage('Login failed. You may have entered an invalid username and/or password. Try again');
}
}
$this->view->form = $form;
}
【问题讨论】:
标签: zend-framework