1 {% extends "base/class.php.twig" %}
4 \Drupal\{{module}}\{{ class }}.
7 {% block namespace_class %}
8 namespace Drupal\{{module}}\CacheContext;
12 use Drupal\Core\Cache\Context\CacheContextInterface;
15 {% block class_declaration %}
19 * @package Drupal\{{module}}
21 class {{ class }} implements CacheContextInterface {% endblock %}
23 {% block class_construct %}
28 public function __construct({{ servicesAsParameters(services)|join(', ') }}) {
29 {{ serviceClassInitialization(services) }}
34 {% block class_methods %}
38 static function getLabel() {
39 drupal_set_message('Lable of cache context');
45 public function getContext() {
46 // Actual logic of context variation will lie here.
52 public function getCacheableMetadata() {
53 // The buble cache metadata.