Class

Symfony\Component\Routing\Matcher\UrlMatcher

class UrlMatcher implements UrlMatcherInterface

UrlMatcher matches URL based on a set of routes.

Methods

__construct(RouteCollection $routes, RequestContext $context)

Constructor.

setContext(RequestContext $context)

Sets the request context.

RequestContext getContext()

Gets the request context.

array match(string $pathinfo)

Tries to match a URL with a set of routes.

Details

at line 41
public __construct(RouteCollection $routes, RequestContext $context)

Constructor.

Parameters

RouteCollection $routes A RouteCollection instance
RequestContext $context The context

at line 54
public setContext(RequestContext $context)

Sets the request context.

Parameters

RequestContext $context The context

at line 64
public RequestContext getContext()

Gets the request context.

Return Value

RequestContext The context

at line 81
public array match(string $pathinfo)

Tries to match a URL with a set of routes.

Parameters

string $pathinfo The path info to be parsed

Return Value

array An array of parameters

Exceptions

ResourceNotFoundException If the resource could not be found
MethodNotAllowedException If the resource was found but the request method is not allowed