class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface

UrlMatcher matches URL based on a set of routes.

Constants

REQUIREMENT_MATCH

REQUIREMENT_MISMATCH

ROUTE_MATCH

Methods

__construct(RouteCollection $routes, RequestContext $context)

No description

setContext(RequestContext $context)

Sets the request context.

getContext()

Gets the request context.

array
match(string $pathinfo)

Tries to match a URL path with a set of routes.

array
matchRequest(Request $request)

Tries to match a request with a set of routes.

Details

at line line 58
__construct(RouteCollection $routes, RequestContext $context)

Parameters

RouteCollection $routes
RequestContext $context

at line line 67
setContext(RequestContext $context)

Sets the request context.

Parameters

RequestContext $context

at line line 75
RequestContext getContext()

Gets the request context.

Return Value

RequestContext The context

at line line 83
array match(string $pathinfo)

Tries to match a URL path with a set of routes.

If the matcher can not find information, it must throw one of the exceptions documented below.

Parameters

string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded)

Return Value

array An array of parameters

Exceptions

NoConfigurationException If no routing configuration could be found
ResourceNotFoundException If the resource could not be found
MethodNotAllowedException If the resource was found but the request method is not allowed

at line line 103
array matchRequest(Request $request)

Tries to match a request with a set of routes.

If the matcher can not find information, it must throw one of the exceptions documented below.

Parameters

Request $request

Return Value

array An array of parameters

Exceptions

NoConfigurationException If no routing configuration could be found
ResourceNotFoundException If no matching resource could be found
MethodNotAllowedException If a matching resource was found but the request method is not allowed

at line line 114
addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider)