function RouteProvider::getRouteCollectionCacheId
Same name in other branches
- 9 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRouteCollectionCacheId()
- 8.9.x core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRouteCollectionCacheId()
- 10 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRouteCollectionCacheId()
Returns the cache ID for the route collection cache.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request object.
Return value
string The cache ID.
1 call to RouteProvider::getRouteCollectionCacheId()
- RouteProvider::getRouteCollectionForRequest in core/
lib/ Drupal/ Core/ Routing/ RouteProvider.php - Finds routes that may potentially match the request.
File
-
core/
lib/ Drupal/ Core/ Routing/ RouteProvider.php, line 453
Class
- RouteProvider
- A Route Provider front-end for all Drupal-stored routes.
Namespace
Drupal\Core\RoutingCode
protected function getRouteCollectionCacheId(Request $request) {
// Include the current language code in the cache identifier as
// the language information can be elsewhere than in the path, for example
// based on the domain.
$this->addExtraCacheKeyPart('language', $this->getCurrentLanguageCacheIdPart());
$this->addExtraCacheKeyPart('query_parameters', $this->getQueryParametersCacheIdPart($request));
// Sort the cache key parts by their provider in order to have predictable
// cache keys.
ksort($this->extraCacheKeyParts);
$key_parts = [];
foreach ($this->extraCacheKeyParts as $provider => $key_part) {
$key_parts[] = '[' . $provider . ']=' . $key_part;
}
return 'route:' . implode(':', $key_parts) . ':' . $request->getPathInfo();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.