i have a situation like this
public function loginAction(){
//my other code
if(!empty($errorMessage)){
$this->view->assign('error',$errorMessage);
}
}
public function authAction(){
//my other code
if($result->isValid()){
$this->_redirect('/currentcontroller/controlpannel');}
else{
$errorMessage = "Wrong username or password provided. Please try again.";
$this->_redirect('/currentcontroller/login');
}
i want to pass $errorMessage to login action in else how to pass it and than how to retrive it there ??
Take a look at the flash messenger action helper: http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.flashmessenger
It allows you to set messages (which are stored in the session), which you can access on the next request.