I'm trying to pass a message from view to layout by using a model.
This does not work when using _redirect();
I know there is a magento core functionality, but I'd like to understand why my custom solution does not work.
$status = Mage::getSingleton('custom/statusobject');
$status ->setMessage('Error:' + $message);
//$status ->getMessage(); Works fine
$this->_redirect('*/*/');
public function indexAction()
{
$status = Mage::getSingleton('custom/statusobject');
$status ->getMessage(); // does not exists
}
**** EDIT **** This does also not work for session
in controller
Mage::getSingleton('core/session')->setError('ERROR');
session_write_close();
$this->_redirectUrl('*/*/');
return;
In my block
$statusobject = Mage::getSingleton('core/session');
$message =$statusobject->getMessages()->getItems();
print_r($message); // empty array
I dont know why my messages are lost after redirect