function RoutePreloader::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/RoutePreloader.php \Drupal\Core\Routing\RoutePreloader::__construct()
  2. 8.9.x core/lib/Drupal/Core/Routing/RoutePreloader.php \Drupal\Core\Routing\RoutePreloader::__construct()
  3. 11.x core/lib/Drupal/Core/Routing/RoutePreloader.php \Drupal\Core\Routing\RoutePreloader::__construct()

Constructs a new RoutePreloader.

Parameters

\Drupal\Core\Routing\RouteProviderInterface $route_provider: The route provider.

\Drupal\Core\State\StateInterface $state: The state key value store.

File

core/lib/Drupal/Core/Routing/RoutePreloader.php, line 49

Class

RoutePreloader
Defines a class that can pre-load non-admin routes.

Namespace

Drupal\Core\Routing

Code

public function __construct(RouteProviderInterface $route_provider, StateInterface $state) {
    $this->routeProvider = $route_provider;
    $this->state = $state;
    if (func_num_args() > 2) {
        @trigger_error(sprintf('Passing a cache bin to %s is deprecated in drupal:10.3.0 and will be removed before drupal:11.0.0. Caching is now managed by the state service. See https://www.drupal.org/node/3177901', __METHOD__), E_USER_DEPRECATED);
    }
}

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