function UrlMatcher::getAttributes

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/UrlMatcher.php \Drupal\Core\Routing\UrlMatcher::getAttributes()
  2. 11.x core/lib/Drupal/Core/Routing/UrlMatcher.php \Drupal\Core\Routing\UrlMatcher::getAttributes()
1 call to UrlMatcher::getAttributes()
Router::doMatchCollection in core/lib/Drupal/Core/Routing/Router.php
Tries to match a URL with a set of routes.

File

core/lib/Drupal/Core/Routing/UrlMatcher.php, line 48

Class

UrlMatcher
Drupal-specific URL Matcher; handles the Drupal "system path" mapping.

Namespace

Drupal\Core\Routing

Code

protected function getAttributes(Route $route, $name, array $attributes) : array {
    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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.