FormRouteEnhancer::enhance

public FormRouteEnhancer::enhance(array $defaults, Request $request)

Update the defaults based on its own data and the request.

Parameters

array $defaults the getRouteDefaults array.:

Request $request the Request instance.:

Return value

array the modified defaults. Each enhancer MUST return the $defaults but may add or remove values.

Overrides RouteEnhancerInterface::enhance

File

core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php, line 23

Class

FormRouteEnhancer
Enhancer to add a wrapping controller for _form routes.

Namespace

Drupal\Core\Routing\Enhancer

Code

public function enhance(array $defaults, Request $request) {
  $defaults['_controller'] = 'controller.form:getContentResult';
  return $defaults;
}
doc_Drupal
2016-10-29 09:15:44
Comments
Leave a Comment

Please login to continue.