interface CacheContextInterface in Render cache 7.2
Provides an interface for defining a cache context service.
Hierarchy
- interface \Drupal\Core\Cache\CacheContextInterface
Expanded class hierarchy of CacheContextInterface
All classes that implement CacheContextInterface
File
- lib/
Drupal/ Core/ Cache/ CacheContextInterface.php, line 13 - Contains \Drupal\Core\Cache\CacheContextInterface.
Namespace
Drupal\Core\CacheView source
interface CacheContextInterface {
/**
* Returns the label of the cache context.
*
* @return string
* The label of the cache context.
*/
public static function getLabel();
/**
* 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 string
* The string representation of the cache context.
*/
public function getContext();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheContextInterface:: |
public | function | Returns the string representation of the cache context. | |
CacheContextInterface:: |
public static | function | Returns the label of the cache context. |