public function processModifyAction() { if (!$this->_request->isXmlHttpRequest() || !$this->_request->isPost()) { $this->_redirector->gotoRoute(array('controller' => 'index', 'module' => 'accounts'), 'admin'); } $return = array(); $accountGateway = new Accounts_Model_AccountGateway(); $form = $accountGateway->getForm('ModifyAccount'); $validForm = $form->isValid($this->_request->getParams()); // Check the form for validity if (!$validForm) { $return['formErrors'] = $form->getMessages(); } else { $form->removeElement('submit'); $account = $accountGateway->saveAccountDetails($form->getValues()); $flashMessenger = $this->_helper->getHelper('FlashMessenger'); $flashMessenger->setNamespace('notifications')->addMessage('Account Modify.'); $return['redirect']['location'] = '/admin/accounts/'; } $this->_helper->json->sendJson($return); }