You are here

public function RouteNameCacheContext::getContext in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php \Drupal\Core\Cache\Context\RouteNameCacheContext::getContext()

Returns the string representation of the cache context.

A cache context service's name is used as a token (placeholder) cache key, and is then replaced with the string returned by this method.

Return value

string The string representation of the cache context.

Overrides RouteCacheContext::getContext

File

core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php, line 27
Contains \Drupal\Core\Cache\Context\RouteNameCacheContext.

Class

RouteNameCacheContext
Defines the RouteCacheContext service, for "per route name" caching.

Namespace

Drupal\Core\Cache\Context

Code

public function getContext() {
  return $this->routeMatch
    ->getRouteName();
}