Answered my own problem.

Apparently I wanted to do getCurrentMessages() as getMessages() only retrieves messages from the internal $_messages property (from the previous request) but not those stored in $_session. addMessage() only puts them in $_session.

Also, the getMessages() method is a little wonky. It says in the Docbloc that there's a parameter but there isn't.

Anyways, all is working now.

Jeff

On 7-Nov-07, at 9:28 AM, Jeffrey Sambells wrote:

Hi All,

I'm having a bit of an issue with the FlashMessenger controller helper.

After adding a message in my controller:

$this->_flashMessenger->addMessage('new message '.date(DATE_RFC2822));

I later on (in a view helper) want to retrieve the messages so I do this, which I think is correct:

$messages = Zend_Controller_Action_HelperBroker ::getExistingHelper('FlashMessenger');

The problem is that the messages don't seem to show up until the following page load.

On a request the page loads and everything seems fine but no messages. If I hit refresh, the messages from the previous request show up and the ones from that request show up in the next request and so on.

I'm not sure what I'm doing wrong. Is there some possibility that the messages I added earlier in the request aren't actually in the messenger yet and I have to do something else to retrieve them?

Thanks

- Jeffrey



Reply via email to