W3cubDocs

/Symfony 2.7

Symfony\Component\Routing\Matcher\ApacheUrlMatcher

class ApacheUrlMatcher extends UrlMatcher

ApacheUrlMatcher matches URL based on Apache mod_rewrite matching (see ApacheMatcherDumper).

Constants

REQUIREMENT_MATCH
REQUIREMENT_MISMATCH
ROUTE_MATCH

Methods

__construct(RouteCollection $routes, RequestContext $context)

Constructor.

from UrlMatcher
setContext(RequestContext $context)

Sets the request context.

from UrlMatcher
RequestContext getContext()

Gets the request context.

from UrlMatcher
array match(string $pathinfo)

Tries to match a URL based on Apache mod_rewrite matching.

array matchRequest(Request $request)

Tries to match a request with a set of routes.

from UrlMatcher
addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) from UrlMatcher

Details

public __construct(RouteCollection $routes, RequestContext $context)

Constructor.

Parameters

RouteCollection $routes A RouteCollection instance
RequestContext $context The context

public setContext(RequestContext $context)

Sets the request context.

Parameters

RequestContext $context The context

public RequestContext getContext()

Gets the request context.

Return Value

RequestContext The context

public array match(string $pathinfo)

Tries to match a URL based on Apache mod_rewrite matching.

Returns false if no route matches the URL.

Parameters

string $pathinfo The pathinfo to be parsed

Return Value

array An array of parameters

Exceptions

MethodNotAllowedException If the current method is not allowed

public 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 The request to match

Return Value

array An array of parameters

Exceptions

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

public addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider)

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.html