public function processAction() { $return = array(); $layoutGateway = new Layouts_Model_LayoutGateway(); $form = $layoutGateway->getForm('ModifyLayout'); if ($form->isValid($this->_request->getPost())) { $layoutGateway->create($form->getValues())->save(); $flashMessenger = $this->_helper->getHelper('FlashMessenger'); $flashMessenger->setNamespace('notifications')->addMessage('Layout updated.'); $return['notification']['target'] = '.notifications'; $return['notification']['content'] = $this->view->displayMessages(true); } else { $return['formErrors'] = $form->getMessages(); } $this->_helper->json->sendJson($return); }