class UrlMatcher in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/symfony-cmf/routing/NestedMatcher/UrlMatcher.php \Symfony\Cmf\Component\Routing\NestedMatcher\UrlMatcher
- 8.0 vendor/symfony/routing/Matcher/UrlMatcher.php \Symfony\Component\Routing\Matcher\UrlMatcher
- 8.0 core/lib/Drupal/Core/Routing/UrlMatcher.php \Drupal\Core\Routing\UrlMatcher
Same name and namespace in other branches
- 8 vendor/symfony-cmf/routing/NestedMatcher/UrlMatcher.php \Symfony\Cmf\Component\Routing\NestedMatcher\UrlMatcher
Extended UrlMatcher to provide an additional interface and enhanced features.
This class requires Symfony 2.2 for a refactoring done to the symfony UrlMatcher
@author Larry Garfield
Hierarchy
- class \Symfony\Component\Routing\Matcher\UrlMatcher implements RequestMatcherInterface, UrlMatcherInterface
- class \Symfony\Cmf\Component\Routing\NestedMatcher\UrlMatcher implements FinalMatcherInterface
Expanded class hierarchy of UrlMatcher
2 files declare their use of UrlMatcher
- UrlMatcher.php in core/
lib/ Drupal/ Core/ Routing/ UrlMatcher.php - Contains \Drupal\Core\Routing\UrlMatcher.
- UrlMatcherTest.php in vendor/
symfony-cmf/ routing/ Tests/ NestedMatcher/ UrlMatcherTest.php
File
- vendor/
symfony-cmf/ routing/ NestedMatcher/ UrlMatcher.php, line 29
Namespace
Symfony\Cmf\Component\Routing\NestedMatcherView source
class UrlMatcher extends SymfonyUrlMatcher implements FinalMatcherInterface {
/**
* {@inheritdoc}
*/
public function finalMatch(RouteCollection $collection, Request $request) {
$this->routes = $collection;
$context = new RequestContext();
$context
->fromRequest($request);
$this
->setContext($context);
return $this
->match($request
->getPathInfo());
}
/**
* {@inheritdoc}
*/
protected function getAttributes(Route $route, $name, array $attributes) {
if ($route instanceof RouteObjectInterface && is_string($route
->getRouteKey())) {
$name = $route
->getRouteKey();
}
$attributes[RouteObjectInterface::ROUTE_NAME] = $name;
$attributes[RouteObjectInterface::ROUTE_OBJECT] = $route;
return $this
->mergeDefaults($attributes, $route
->getDefaults());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UrlMatcher:: |
protected | property | ||
UrlMatcher:: |
protected | property | ||
UrlMatcher:: |
protected | property | ||
UrlMatcher:: |
protected | property | ||
UrlMatcher:: |
protected | property | ||
UrlMatcher:: |
protected | property | ||
UrlMatcher:: |
public | function | ||
UrlMatcher:: |
public | function |
Matches a request against a route collection and returns exactly one result. Overrides FinalMatcherInterface:: |
1 |
UrlMatcher:: |
protected | function |
Returns an array of values to use as request attributes. Overrides UrlMatcher:: |
|
UrlMatcher:: |
public | function |
Gets the request context. Overrides RequestContextAwareInterface:: |
|
UrlMatcher:: |
protected | function | ||
UrlMatcher:: |
protected | function | Handles specific route requirements. | 1 |
UrlMatcher:: |
public | function |
Tries to match a URL path with a set of routes. Overrides UrlMatcherInterface:: |
5 |
UrlMatcher:: |
protected | function | Tries to match a URL with a set of routes. | 1 |
UrlMatcher:: |
public | function |
Tries to match a request with a set of routes. Overrides RequestMatcherInterface:: |
|
UrlMatcher:: |
protected | function | Get merged default parameters. | |
UrlMatcher:: |
constant | |||
UrlMatcher:: |
constant | |||
UrlMatcher:: |
constant | |||
UrlMatcher:: |
public | function |
Sets the request context. Overrides RequestContextAwareInterface:: |
|
UrlMatcher:: |
public | function | Constructor. | 4 |