Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 public function testSetRequestParamsDetectsJsonPCallback()
 {
     $this->route->setRequestParams(array('callback' => 'myCallback'));
     $this->assertEquals('jsonp', $this->route->getExtension());
     $this->assertEquals('myCallback', $this->route->getJsonPCallback());
 }