public function indexAction() { // action body $key = new Application_Model_DbTable_DbKeycode(); $data = $key->getKeyCode(); $this->view->data = $data; if ($this->getRequest()->isPost()) { $post = $this->getRequest()->getPost(); try { $db = $key->updateKeyCode($post, $data); Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', self::REDIRECT_URL); } catch (Exception $e) { $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; } } //with xml file // action body /*$company_info = new Zend_Config_Xml(APPLICATION_PATH.'/configs/Config.xml'); $this->view->company_info = $company_info; $xml = simplexml_load_file(APPLICATION_PATH.'/configs/Config.xml'); //transforming the object in xml format $xmlFormat = $xml->asXML(); if($this->getRequest()->isPost()){ $company_data=$this->getRequest()->getPost(); try { //loop to get data update to xml file foreach ($company_data as $key => $val){ $xml->$key = $val; } $xml->saveXML(APPLICATION_PATH.'/configs/Config.xml'); Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', self::REDIRECT_URL); } catch (Exception $e) { $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; } }*/ }