You are here

public function RouteAdminCacheContext::getContext in Responsive Theme Preview 8

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 CacheContextInterface::getContext

File

src/Cache/RouteAdminCacheContext.php, line 43

Class

RouteAdminCacheContext
Defines the RouteCacheContext service for "per admin route" caching.

Namespace

Drupal\responsive_preview\Cache

Code

public function getContext() {
  return $this->routeAdminContext
    ->isAdminRoute() ? '1' : '0';
}