class RouteProvider
Same name in this branch
- 10 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider
- 9 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider
- 8.9.x core/modules/simpletest/src/RouteProvider.php \Drupal\simpletest\RouteProvider
- 8.9.x core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider
- 8.9.x core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider
- 11.x core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider
- 11.x core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider
Rebuilds the router when the provider is instantiated.
Hierarchy
- class \Drupal\KernelTests\RouteProvider extends \Drupal\Core\Routing\PreloadableRouteProviderInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait
Expanded class hierarchy of RouteProvider
1 string reference to 'RouteProvider'
- LocalTaskIntegrationTestBase::getLocalTaskManager in core/
tests/ Drupal/ Tests/ Core/ Menu/ LocalTaskIntegrationTestBase.php - Sets up the local task manager for the test.
File
-
core/
tests/ Drupal/ KernelTests/ RouteProvider.php, line 14
Namespace
Drupal\KernelTestsView source
class RouteProvider implements PreloadableRouteProviderInterface {
use \Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
* The route provider service.
*/
protected RouteProviderBase $service;
/**
* Loads the real route provider from the container and rebuilds the router.
*
* @return \Drupal\Core\Routing\PreloadableRouteProviderInterface|\Symfony\Component\EventDispatcher\EventSubscriberInterface
* The route provider.
*/
protected function lazyLoadItself() {
if (!isset($this->service)) {
$container = \Drupal::getContainer();
$this->service = $container->get('test.router.route_provider');
$container->get('router.builder')
->rebuild();
}
return $this->service;
}
/**
* {@inheritdoc}
*/
public function getRouteCollectionForRequest(Request $request) {
return $this->lazyLoadItself()
->getRouteCollectionForRequest($request);
}
/**
* {@inheritdoc}
*/
public function getRouteByName($name) {
return $this->lazyLoadItself()
->getRouteByName($name);
}
/**
* {@inheritdoc}
*/
public function preLoadRoutes($names) {
return $this->lazyLoadItself()
->preLoadRoutes($names);
}
/**
* {@inheritdoc}
*/
public function getRoutesByNames($names) {
return $this->lazyLoadItself()
->getRoutesByNames($names);
}
/**
* {@inheritdoc}
*/
public function getCandidateOutlines(array $parts) {
return $this->lazyLoadItself()
->getCandidateOutlines($parts);
}
/**
* {@inheritdoc}
*/
public function getRoutesByPattern($pattern) {
return $this->lazyLoadItself()
->getRoutesByPattern($pattern);
}
/**
* {@inheritdoc}
*/
public function routeProviderRouteCompare(array $a, array $b) {
return $this->lazyLoadItself()
->routeProviderRouteCompare($a, $b);
}
/**
* {@inheritdoc}
*/
public function getAllRoutes() {
return $this->lazyLoadItself()
->getAllRoutes();
}
/**
* {@inheritdoc}
*/
public function reset() {
return $this->lazyLoadItself()
->reset();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
DependencySerializationTrait::$_entityStorages | protected | property | |||
DependencySerializationTrait::$_serviceIds | protected | property | |||
DependencySerializationTrait::__sleep | public | function | 1 | ||
DependencySerializationTrait::__wakeup | public | function | #[\ReturnTypeWillChange] | 2 | |
RouteProvider::$service | protected | property | The route provider service. | ||
RouteProvider::getAllRoutes | public | function | Returns all the routes on the system. | Overrides RouteProviderInterface::getAllRoutes | |
RouteProvider::getCandidateOutlines | public | function | |||
RouteProvider::getRouteByName | public | function | Find the route using the provided route name. | Overrides RouteProviderInterface::getRouteByName | |
RouteProvider::getRouteCollectionForRequest | public | function | Finds routes that may potentially match the request. | Overrides RouteProviderInterface::getRouteCollectionForRequest | |
RouteProvider::getRoutesByNames | public | function | Find many routes by their names using the provided list of names. | Overrides RouteProviderInterface::getRoutesByNames | |
RouteProvider::getRoutesByPattern | public | function | Get all routes which match a certain pattern. | Overrides RouteProviderInterface::getRoutesByPattern | |
RouteProvider::lazyLoadItself | protected | function | Loads the real route provider from the container and rebuilds the router. | ||
RouteProvider::preLoadRoutes | public | function | Pre-load routes by their names using the provided list of names. | Overrides PreloadableRouteProviderInterface::preLoadRoutes | |
RouteProvider::reset | public | function | Resets the route provider object. | Overrides RouteProviderInterface::reset | |
RouteProvider::routeProviderRouteCompare | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.