loadLayout(); $this->renderLayout(); } public function ajaxAction() { $this->getResponse()->setHeader('Content-type', 'text/json; charset=UTF-8'); if($this->getRequest()->getParam('number',false)) { $html = $this->getLayout()->createBlock('pacsoft/tracking')->setTemplate('pacsoft/tracking/result.phtml')->toHtml(); $this->getResponse()->setBody(json_encode(array('html' => $html))); } else { $this->getResponse()->setBody(json_encode(array('html' => ''))); } } }