VikingBlooded
VikingBlooded

Reputation: 859

Zend FlashMessenger

Having an issue, don't know why this is happening:

In the first instance, everything works just fine, the message is set and it displays:

$this->_helper->FlashMessenger()
              ->setNamespace('success')
              ->addMessage('Success!')
              ->addMessage('User ' . $this->_request->getPost('user_name') . ' sucessfully added!');
$this->redirect('users/index');

However, in this instance, it fails with the message:

Warning: Missing argument 1 for Zend_Controller_Action_Helper_FlashMessenger::direct()

$this->_helper->FlashMessenger()
              ->setNamespace('error')
              ->addMessage('Failure!')
              ->addMessage('User was not added, please see errors below.');

Upvotes: 0

Views: 147

Answers (1)

Daniel Gadawski
Daniel Gadawski

Reputation: 1923

Try changing your code to:

$this->_helper->getHelper('FlashMessenger')
              ->setNamespace('error')
              ->addMessage('Failure!')
              ->addMessage('User was not added, please see errors below.');

Upvotes: 0

Related Questions