public function editInterestAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $ajaxRes = array('success' => 0, 'interestid' => null, 'interesttext' => null); if ($this->getRequest()->isXmlHttpRequest()) { $params = $this->getRequest()->getParams(); $id = $params['id'][0]; if ($id > 0) { //$client = PR_Session::getSession(PR_Session::SESSION_USER); $core = new PR_Api_Core_CandidateClass(); $res = $core->getInterest($id); //echo("testt:<pre>");print_r($res);echo("</pre>"); foreach ($res as $record) { $ajaxRes['interestid'] = $record["interestid"]; $ajaxRes['interesttext'] = $record["interesttext"]; } $ajaxRes['success'] = 1; } } $response = $this->getResponse(); $response->clearAllHeaders()->clearBody(); $ajaxRes = json_encode($ajaxRes); $response->setHeader('Content-type', 'application/json'); $response->setHeader('Content-Length', strlen($ajaxRes), true)->setBody($ajaxRes); }