Mercurial > hg > isophonics-drupal-site
view core/modules/layout_builder/src/Routing/LayoutBuilderRouteEnhancer.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
line wrap: on
line source
<?php namespace Drupal\layout_builder\Routing; use Drupal\Core\Routing\EnhancerInterface; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Request; /** * Converts the query parameter for layout rebuild status to a route default. * * @internal */ class LayoutBuilderRouteEnhancer implements EnhancerInterface { /** * {@inheritdoc} */ public function enhance(array $defaults, Request $request) { $route = $defaults[RouteObjectInterface::ROUTE_OBJECT]; if ($route->hasOption('_layout_builder')) { $defaults['is_rebuilding'] = (bool) $request->query->get('layout_is_rebuilding', FALSE); } return $defaults; } }