Mercurial > hg > isophonics-drupal-site
comparison core/modules/layout_builder/src/Routing/LayoutBuilderRouteEnhancer.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\layout_builder\Routing; | |
4 | |
5 use Drupal\Core\Routing\EnhancerInterface; | |
6 use Symfony\Cmf\Component\Routing\RouteObjectInterface; | |
7 use Symfony\Component\HttpFoundation\Request; | |
8 | |
9 /** | |
10 * Converts the query parameter for layout rebuild status to a route default. | |
11 * | |
12 * @internal | |
13 */ | |
14 class LayoutBuilderRouteEnhancer implements EnhancerInterface { | |
15 | |
16 /** | |
17 * {@inheritdoc} | |
18 */ | |
19 public function enhance(array $defaults, Request $request) { | |
20 $route = $defaults[RouteObjectInterface::ROUTE_OBJECT]; | |
21 if ($route->hasOption('_layout_builder')) { | |
22 $defaults['is_rebuilding'] = (bool) $request->query->get('layout_is_rebuilding', FALSE); | |
23 } | |
24 return $defaults; | |
25 } | |
26 | |
27 } |