public function match($url, $http_method = self::METHOD_GET)
    {
        // Make sure there is a trailing slash
        $url = rtrim($url, '/') . '/';

        foreach ($this->routes[$http_method] as $route) {
            if (preg_match($route->pattern(), $url)) {
                return $route;
            }
        }
        return null;
    }
public function match($url, $http_method = self::METHOD_GET)
    {
        // Make sure there is a trailing slash
        $url = rtrim($url, '/') . '/';

        foreach ($this->routes[$http_method] as $route) {
            if (preg_match($route->pattern(), $url)) {
                return $route;
            }
        }
        return null;
    }
public function match ( $ url , $ http_method = self :: METHOD_GET ) { // Make sure there is a trailing slash $ url = rtrim ( $ url , '/' ) . '/' ; foreach ( $ this -> routes [ $ http_method ] as $ route ) { if ( preg_match ( $ route -> pattern ( ) , $ url ) ) { return $ route ; } } return null ; }
Returns a Route object if matching URL is found

@param  string $url
@param  string $http_method
@return Route|null
Returns a Route object if matching URL is found