class LayoutBuilderUiCacheContext in Drupal 9
Same name and namespace in other branches
- 8 core/modules/layout_builder/src/Cache/LayoutBuilderUiCacheContext.php \Drupal\layout_builder\Cache\LayoutBuilderUiCacheContext
Determines if an entity is being viewed in the Layout Builder UI.
Cache context ID: 'route.name.is_layout_builder_ui'.
@internal Tagged services are internal.
Hierarchy
- class \Drupal\Core\Cache\Context\RouteCacheContext implements CacheContextInterface
- class \Drupal\Core\Cache\Context\RouteNameCacheContext
- class \Drupal\layout_builder\Cache\LayoutBuilderUiCacheContext
- class \Drupal\Core\Cache\Context\RouteNameCacheContext
Expanded class hierarchy of LayoutBuilderUiCacheContext
1 string reference to 'LayoutBuilderUiCacheContext'
- layout_builder.services.yml in core/
modules/ layout_builder/ layout_builder.services.yml - core/modules/layout_builder/layout_builder.services.yml
1 service uses LayoutBuilderUiCacheContext
- cache_context.route.name.is_layout_builder_ui in core/
modules/ layout_builder/ layout_builder.services.yml - Drupal\layout_builder\Cache\LayoutBuilderUiCacheContext
File
- core/
modules/ layout_builder/ src/ Cache/ LayoutBuilderUiCacheContext.php, line 15
Namespace
Drupal\layout_builder\CacheView source
class LayoutBuilderUiCacheContext extends RouteNameCacheContext {
/**
* {@inheritdoc}
*/
public static function getLabel() {
return t('Layout Builder user interface');
}
/**
* {@inheritdoc}
*/
public function getContext() {
return 'is_layout_builder_ui.' . (int) (strpos($this->routeMatch
->getRouteName(), 'layout_builder.') !== 0);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LayoutBuilderUiCacheContext:: |
public | function |
Returns the string representation of the cache context. Overrides RouteNameCacheContext:: |
|
LayoutBuilderUiCacheContext:: |
public static | function |
Returns the label of the cache context. Overrides RouteNameCacheContext:: |
|
RouteCacheContext:: |
protected | property | The route match. | |
RouteCacheContext:: |
public | function |
Gets the cacheability metadata for the context. Overrides CacheContextInterface:: |
|
RouteCacheContext:: |
public | function | Constructs a new RouteCacheContext class. |