comparison core/modules/layout_builder/src/Cache/LayoutBuilderUiCacheContext.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
1 <?php
2
3 namespace Drupal\layout_builder\Cache;
4
5 use Drupal\Core\Cache\Context\RouteNameCacheContext;
6
7 /**
8 * Determines if an entity is being viewed in the Layout Builder UI.
9 *
10 * Cache context ID: 'route.name.is_layout_builder_ui'.
11 *
12 * @internal
13 * Tagged services are internal.
14 */
15 class LayoutBuilderUiCacheContext extends RouteNameCacheContext {
16
17 /**
18 * {@inheritdoc}
19 */
20 public static function getLabel() {
21 return t('Layout Builder user interface');
22 }
23
24 /**
25 * {@inheritdoc}
26 */
27 public function getContext() {
28 return 'is_layout_builder_ui.' . (int) (strpos($this->routeMatch->getRouteName(), 'layout_builder.') !== 0);
29 }
30
31 }