protected function UrlMatcher::getAttributes

Same name in this branch
  1. 8.x drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php \Symfony\Component\Routing\Matcher\UrlMatcher::getAttributes()
  2. 8.x drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/NestedMatcher/UrlMatcher.php \Symfony\Cmf\Component\Routing\NestedMatcher\UrlMatcher::getAttributes()

Returns an array of values to use as request attributes.

As this method requires the Route object, it is not available in matchers that do not have access to the matched Route instance (like the PHP and Apache matcher dumpers).

Parameters

Route $route The route we are matching against:

string $name The name of the route:

array $attributes An array of attributes from the matcher:

Return value

array An array of parameters

Overrides UrlMatcher::getAttributes

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/NestedMatcher/UrlMatcher.php, line 38

Class

UrlMatcher
Extended UrlMatcher to provide an additional interface and enhanced features.

Namespace

Symfony\Cmf\Component\Routing\NestedMatcher

Code

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());
}