When using the JSON context with the ContextSwitch helper, all view
variables are returned in the JSON response. So the easiest thing to do is
to provide the FlashMessenger messages to the view.

Add one of these lines in your controller's action method:

// Get messages stored during previous request:
$this->view->flashMessages = $this->getMessages();

// Get messages stored during current request:
$this->view->flashMessages = $this->getCurrentMessages();

Or you can use array_merge() to merge both of them together.

--
*Hector Virgen*
Sr. Web Developer
http://www.virgentech.com

Reply via email to