/** * getbychar action for article controller */ public function getbycharAction() { // action body try { $term = $this->getRequest()->getParam("term"); $mdlArticle = new Content_Model_Article(); $articleList = $mdlArticle->getByChar($term); $data = array(); foreach ($articleList as $article) { $data[] = array("id" => $article->id, "value" => $article->title); } echo Zend_Json::encode($data); $this->_helper->layout()->disableLayout(); } catch (Exception $e) { echo $e->getMessage(); } }