function LayoutTempstoreRouteEnhancer::enhance
Same name in other branches
- 10 core/modules/layout_builder/src/Routing/LayoutTempstoreRouteEnhancer.php \Drupal\layout_builder\Routing\LayoutTempstoreRouteEnhancer::enhance()
- 11.x core/modules/layout_builder/src/Routing/LayoutTempstoreRouteEnhancer.php \Drupal\layout_builder\Routing\LayoutTempstoreRouteEnhancer::enhance()
Overrides EnhancerInterface::enhance
File
-
core/
modules/ layout_builder/ src/ Routing/ LayoutTempstoreRouteEnhancer.php, line 36
Class
- LayoutTempstoreRouteEnhancer
- Loads the section storage from the layout tempstore.
Namespace
Drupal\layout_builder\RoutingCode
public function enhance(array $defaults, Request $request) {
$parameters = $defaults[RouteObjectInterface::ROUTE_OBJECT]->getOption('parameters');
if (isset($parameters['section_storage']['layout_builder_tempstore']) && isset($defaults['section_storage']) && $defaults['section_storage'] instanceof SectionStorageInterface) {
$defaults['section_storage'] = $this->layoutTempstoreRepository
->get($defaults['section_storage']);
}
return $defaults;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.