function LayoutBuilderUiCacheContext::getContext
Overrides RouteNameCacheContext::getContext
File
-
core/
modules/ layout_builder/ src/ Cache/ LayoutBuilderUiCacheContext.php, line 27
Class
- LayoutBuilderUiCacheContext
- Determines if an entity is being viewed in the Layout Builder UI.
Namespace
Drupal\layout_builder\CacheCode
public function getContext() {
$route_name = $this->routeMatch
->getRouteName();
if ($route_name && str_starts_with($route_name, 'layout_builder.')) {
return 'is_layout_builder_ui.0';
}
return 'is_layout_builder_ui.1';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.