示例#1
0
 /**
  * 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);
     }
 }
示例#2
0
 /**
  * Pre process
  * @return void
  */
 protected function preProcess()
 {
     Logger::info("app:process:pre");
     Router::process();
 }
示例#3
0
 /**
  * Pre process
  * @return void
  */
 protected function preProcess()
 {
     Router::process();
     Response::switchType('CLI');
 }
示例#4
0
 /**
  * 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());
 }
示例#5
0
 /**
  * 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');
     }
 }