示例#1
0
 public function matches(string $uri) : bool
 {
     if ($this->pattern->matches($uri)) {
         $this->uriParams = $this->pattern->getMatches();
         foreach ($this->routes as $route) {
             if ($route->matches($uri)) {
                 $this->requestHandler = $route->getRequestHandler();
                 $this->uriParams = array_merge($this->uriParams, $route->getUriParams());
                 return true;
             }
         }
     }
     return false;
 }
示例#2
0
 public function getUriParams() : array
 {
     return $this->pattern->getMatches();
 }