You are here

public function Router::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::__construct()
  2. 10 core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::__construct()

Constructs a new Router.

Parameters

\Symfony\Cmf\Component\Routing\RouteProviderInterface $route_provider: The route provider.

\Drupal\Core\Path\CurrentPathStack $current_path: The current path stack.

\Symfony\Component\Routing\Generator\UrlGeneratorInterface $url_generator: The URL generator.

Overrides UrlMatcher::__construct

File

core/lib/Drupal/Core/Routing/Router.php, line 84

Class

Router
Router implementation in Drupal.

Namespace

Drupal\Core\Routing

Code

public function __construct(BaseRouteProviderInterface $route_provider, CurrentPathStack $current_path, BaseUrlGeneratorInterface $url_generator) {
  parent::__construct($current_path);
  $this->routeProvider = $route_provider;
  $this->urlGenerator = $url_generator;
}