interface RouteEnhancerInterface

A route enhancer can change the values in the route data arrays

This is useful to provide information to the rest of the routing system that can be inferred from other parameters rather than hardcode that information in every route.

@author David Buchmann

Hierarchy

Expanded class hierarchy of RouteEnhancerInterface

All classes that implement RouteEnhancerInterface

6 files declare their use of RouteEnhancerInterface
AjaxEnhancer.php in drupal/core/lib/Drupal/Core/Routing/Enhancer/AjaxEnhancer.php
Contains \Drupal\Core\Routing\Enhancer\AjaxEnhancer.
ContentControllerEnhancer.php in drupal/core/lib/Drupal/Core/Routing/Enhancer/ContentControllerEnhancer.php
Contains \Drupal\Core\Routing\Enhancer\ContentControllerEnhancer.
DynamicRouter.php in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/DynamicRouter.php
EntityFormEnhancer.php in drupal/core/lib/Drupal/Core/Entity/Enhancer/EntityFormEnhancer.php
Contains \Drupal\Core\Entity\Enhancer\EntityFormEnhancer.
FormEnhancer.php in drupal/core/lib/Drupal/Core/Routing/Enhancer/FormEnhancer.php
Contains \Drupal\Core\Routing\Enhancer\FormEnhancer.

... See full list

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/Enhancer/RouteEnhancerInterface.php, line 17

Namespace

Symfony\Cmf\Component\Routing\Enhancer
View source
interface RouteEnhancerInterface {

  /**
   * Update the defaults based on its own data and the request.
   *
   * @param array $defaults the getRouteDefaults array
   *
   * @return array the modified defaults. Each enhancer MUST return the $defaults but may add or remove values
   */
  public function enhance(array $defaults, Request $request);

}

Members

Namesort descending Modifiers Type Description Overrides
RouteEnhancerInterface::enhance public function Update the defaults based on its own data and the request. 9