public function searchAction() { if ($this->getRequest()->isXmlHttpRequest()) { $request = $this->getRequest(); $sm = $this->getServiceLocator(); $oFormModel = $sm->get('FormsElementTable'); $aFormModel = $oFormModel->getPolaFormularza(2); if ($request->isPost()) { $oPost = $request->getPost(); $aPost = $oPost->toArray(); $container = new \Zend\Session\Container($this->sSessionNameSpace); foreach ($aPost as $klucz => $wartosc) { $container->offsetSet($klucz, $wartosc); } $ind = $this->params()->fromQuery('orderby', 0); $direction = $this->params()->fromQuery('direction', 'desc'); $container->offsetSet('direction', $direction); $container->offsetSet('orderby', $ind); $xml = '<info>Ok</info>'; $this->getResponse()->getHeaders()->addHeaders(array('Content-type' => 'text/xml')); return $this->getResponse()->setContent($xml); } $oForm = new Form(); $oForm->setPokazPrzyciskZapisz(false); $xml = $oForm->getXMLForm($aFormModel); $this->getResponse()->getHeaders()->addHeaders(array('Content-type' => 'text/xml')); return $this->getResponse()->setContent($xml); } }
public function infoAction() { $id = $this->getEvent()->getRouteMatch()->getParam('id'); if ($this->getRequest()->isXmlHttpRequest()) { $sm = $this->getServiceLocator(); $oFormModel = $sm->get('FormsElementTable'); $aFormModel = $oFormModel->getPolaFormularza(3); $oForm = new Form(); $oForm->setPokazPrzyciskZapisz(false); $xml = $oForm->getXMLForm($aFormModel); $this->getResponse()->getHeaders()->addHeaders(array('Content-type' => 'text/xml')); return $this->getResponse()->setContent($xml); } }