/** * 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; }
/** * */ public function testGetAction() { $route = new Route(['GET'], '/foo', 'FooController::fooAction'); $this->assertEquals('FooController::fooAction', $route->getAction()); }