コード例 #1
0
ファイル: Controller.php プロジェクト: abcarroll/DABL
 /**
  * @param ControllerRoute $route
  * @return Controller
  */
 protected function setRoute(ControllerRoute $route = null)
 {
     $this->route = $route;
     if (null !== $route) {
         if ($route->getViewDir()) {
             $this->viewDir = $route->getViewDir();
         }
         $this->renderPartial = $route->isPartial();
         if ($route->getExtension()) {
             $this->outputFormat = $route->getExtension();
         }
     }
     return $this;
 }
コード例 #2
0
 /**
  * @covers ControllerRoute::setHeaders
  */
 public function testSetHeadersDetectsAjax()
 {
     $this->route->setPartial(false);
     $this->route->setHeaders(array('X-Requested-With' => 'XMLHttpRequest'));
     $this->assertTrue($this->route->isPartial());
 }