function EnhancerInterface::enhance
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Routing/EnhancerInterface.php \Drupal\Core\Routing\EnhancerInterface::enhance()
- 10 core/lib/Drupal/Core/Routing/EnhancerInterface.php \Drupal\Core\Routing\EnhancerInterface::enhance()
Updates the defaults for a route definition based on the request.
Parameters
array $defaults: The defaults, maps to '_defaults' in the route definition YAML.
\Symfony\Component\HttpFoundation\Request $request: The Request instance.
Return value
array The modified defaults. Each enhancer MUST return the $defaults but may add or remove values.
3 methods override EnhancerInterface::enhance()
- LayoutTempstoreRouteEnhancer::enhance in core/
modules/ layout_builder/ src/ Routing/ LayoutTempstoreRouteEnhancer.php - Updates the defaults for a route definition based on the request.
- ResourceVersionRouteEnhancer::enhance in core/
modules/ jsonapi/ src/ Revisions/ ResourceVersionRouteEnhancer.php - Updates the defaults for a route definition based on the request.
- RouteEnhancer::enhance in core/
modules/ jsonapi/ src/ Routing/ RouteEnhancer.php - Updates the defaults for a route definition based on the request.
File
-
core/
lib/ Drupal/ Core/ Routing/ EnhancerInterface.php, line 24
Class
- EnhancerInterface
- A route enhance service to determine route enhance rules.
Namespace
Drupal\Core\RoutingCode
public function enhance(array $defaults, Request $request);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.