Пример #1
0
 /**
  * Dispatches the route and returns the response.
  *
  * @access  public
  * @return  \mako\http\Response
  */
 public function dispatch()
 {
     $returnValue = $this->beforeFilters();
     if (!empty($returnValue)) {
         $this->response->body($returnValue);
     } else {
         $action = $this->route->getAction();
         if ($action instanceof Closure) {
             $this->dispatchClosure($action);
         } else {
             $this->dispatchController($action);
         }
         if (!$this->skipAfterFilters) {
             $this->afterFilters();
         }
     }
     return $this->response;
 }
Пример #2
0
 /**
  *
  */
 public function testGetAction()
 {
     $route = new Route(['GET'], '/foo', 'FooController::fooAction');
     $this->assertEquals('FooController::fooAction', $route->getAction());
 }