1234567891011121314151617181920212223242526 |
- <?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();
- }
- }
|