class HighContrastCacheContext in High contrast 8
Defines the HighContrastCacheContext service.
This allows caching of high and normal contrast versions of pages.
Hierarchy
- class \Drupal\high_contrast\Cache\Context\HighContrastCacheContext implements CacheContextInterface
Expanded class hierarchy of HighContrastCacheContext
1 string reference to 'HighContrastCacheContext'
1 service uses HighContrastCacheContext
File
- src/
Cache/ Context/ HighContrastCacheContext.php, line 14
Namespace
Drupal\high_contrast\Cache\ContextView source
class HighContrastCacheContext implements CacheContextInterface {
/**
* {@inheritdoc}
*/
public static function getLabel() {
return t('High contrast');
}
/**
* {@inheritdoc}
*/
public function getContext() {
return HighContrastTrait::highContrastEnabled();
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata() {
return new CacheableMetadata();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HighContrastCacheContext:: |
public | function |
Gets the cacheability metadata for the context. Overrides CacheContextInterface:: |
|
HighContrastCacheContext:: |
public | function |
Returns the string representation of the cache context. Overrides CacheContextInterface:: |
|
HighContrastCacheContext:: |
public static | function |
Returns the label of the cache context. Overrides CacheContextInterface:: |