示例#1
0
 /**
  * Find and dispatch a route based on the request http method and uri.
  *
  * @param string $method The HTTP method of the request, that should be GET, POST, PUT, PATCH or DELETE.
  * @param string $uri    The URi of request.
  *
  * @return mixed The request response
  */
 public function dispatch($method, $uri)
 {
     if ($route = $this->match($method, $uri)) {
         return $this->strategy->dispatch($route['action'], $route['params']);
     }
     $this->dispatchNotFoundRoute($method, $uri);
 }