2

我正在尝试使用flashMessenger并在重定向到另一个页面之前显示错误消息,但它没有显示错误消息,只需执行重定向,

以下是我在控制器中使用的

$this->_helper->flashMessenger->addMessage('this user name is already taken  please choose a another');
$message = $this->_helper->flashMessenger->getCurrentMessages(); 
echo($message[0]);
sleep(5);
$this->_redirect('index/login'); 

谁能告诉我为什么

4

1 回答 1

0
No need of Flash Messenger for this...


Check Username before this.

If Username exists You can set Message on the controller Itself.
Eg. $egForm = new EgForm();
$egForm->get('form_element_name')->setMessages(array('this user name is already taken  please choose a   anoth
于 2013-10-05T11:13:08.253 回答