You are here

protected function UrlMatcher::getAttributes in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony-cmf/routing/NestedMatcher/UrlMatcher.php \Symfony\Cmf\Component\Routing\NestedMatcher\UrlMatcher::getAttributes()
  2. 8 vendor/symfony/routing/Matcher/UrlMatcher.php \Symfony\Component\Routing\Matcher\UrlMatcher::getAttributes()
Same name and namespace in other branches
  1. 8.0 vendor/symfony-cmf/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

vendor/symfony-cmf/routing/NestedMatcher/UrlMatcher.php, line 47

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