/** * Pre process * @throws ApplicationException * @return void */ protected function preProcess() { Logger::info("app:process:pre"); Router::process(); // disable layout for AJAX requests if ($this->getRequest()->isXmlHttpRequest()) { $this->useLayout(false); } }
/** * Pre process * @return void */ protected function preProcess() { Logger::info("app:process:pre"); Router::process(); }
/** * Pre process * @return void */ protected function preProcess() { Router::process(); Response::switchType('CLI'); }
/** * Test run Error Controller */ public function testErrorController() { // setup Request Request::setRequestUri(uniqid('module') . '/' . uniqid('controller')); Request::setMethod(Request::METHOD_GET); // run Router Router::process(); // run Application $this->getApp()->process(); $this->assertEquals(Router::getErrorModule(), $this->getApp()->getModule()); $this->assertEquals(Router::getErrorController(), $this->getApp()->getController()); }
/** * Pre process * * @return void * @throws ApplicationException */ protected function preProcess() { Router::process(); // disable Layout for XmlHttpRequests if (Request::isXmlHttpRequest()) { $this->layoutFlag = false; } // switch to JSON response based on Accept header if (Request::getAccept([Request::TYPE_HTML, Request::TYPE_JSON]) == Request::TYPE_JSON) { $this->layoutFlag = false; Response::switchType('JSON'); } }