You are here

public function RouteProvider::preLoadRoutes in Drupal 9

Same name in this branch
  1. 9 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::preLoadRoutes()
  2. 9 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::preLoadRoutes()
Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::preLoadRoutes()

Pre-load routes by their names using the provided list of names.

This method exists in order to allow performance optimizations. It allows pre-loading serialized routes that may latter be retrieved using ::getRoutesByName()

Parameters

string[] $names: Array of route names to load.

Overrides PreloadableRouteProviderInterface::preLoadRoutes

File

core/tests/Drupal/KernelTests/RouteProvider.php, line 48

Class

RouteProvider
Rebuilds the router when the provider is instantiated.

Namespace

Drupal\KernelTests

Code

public function preLoadRoutes($names) {
  return $this
    ->lazyLoadItself()
    ->preLoadRoutes($names);
}