public function TestCacheBlock::getCacheContexts in Drupal 10
Same name and namespace in other branches
- 8 core/modules/block/tests/modules/block_test/src/Plugin/Block/TestCacheBlock.php \Drupal\block_test\Plugin\Block\TestCacheBlock::getCacheContexts()
- 9 core/modules/block/tests/modules/block_test/src/Plugin/Block/TestCacheBlock.php \Drupal\block_test\Plugin\Block\TestCacheBlock::getCacheContexts()
Overrides ContextAwarePluginTrait::getCacheContexts
File
- core/
modules/ block/ tests/ modules/ block_test/ src/ Plugin/ Block/ TestCacheBlock.php, line 33
Class
- TestCacheBlock
- Provides a block to test caching.
Namespace
Drupal\block_test\Plugin\BlockCode
public function getCacheContexts() {
return \Drupal::state()
->get('block_test.cache_contexts', []);
}