RouteNameCacheContext.php
Same filename in other branches
Namespace
Drupal\Core\Cache\ContextFile
-
core/
lib/ Drupal/ Core/ Cache/ Context/ RouteNameCacheContext.php
View source
<?php
namespace Drupal\Core\Cache\Context;
/**
* Defines the RouteCacheContext service, for "per route name" caching.
*
* Cache context ID: 'route.name'.
*/
class RouteNameCacheContext extends RouteCacheContext {
/**
* {@inheritdoc}
*/
public static function getLabel() {
return t('Route name');
}
/**
* {@inheritdoc}
*/
public function getContext() {
return $this->routeMatch
->getRouteName();
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
RouteNameCacheContext | Defines the RouteCacheContext service, for "per route name" caching. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.