public function EntityFormEnhancer::enhance

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

Parameters

array $defaults the getRouteDefaults array:

Return value

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

Overrides RouteEnhancerInterface::enhance

File

drupal/core/lib/Drupal/Core/Entity/Enhancer/EntityFormEnhancer.php, line 39
Contains \Drupal\Core\Entity\Enhancer\EntityFormEnhancer.

Class

EntityFormEnhancer
Enhances an entity form route with the appropriate controller.

Namespace

Drupal\Core\Entity\Enhancer

Code

public function enhance(array $defaults, Request $request) {
  if (empty($defaults['_controller']) && !empty($defaults['_entity_form']) && $this->negotiation
    ->getContentType($request) === 'html') {
    $defaults['_controller'] = '\\Drupal\\Core\\Entity\\HtmlEntityFormController::content';
  }
  return $defaults;
}