0
votes

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.');
1

1 Answers

0
votes

Try changing your code to:

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