You are here

public function ContentControllerSubscriber::onRequestDeriveFormWrapper in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/EventSubscriber/ContentControllerSubscriber.php \Drupal\Core\EventSubscriber\ContentControllerSubscriber::onRequestDeriveFormWrapper()

Sets the _controller on a request when a _form is defined.

Parameters

\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The event to process.

File

core/lib/Drupal/Core/EventSubscriber/ContentControllerSubscriber.php, line 28
Contains \Drupal\Core\EventSubscriber\ContentControllerSubscriber.

Class

ContentControllerSubscriber
Sets the request format onto the request object.

Namespace

Drupal\Core\EventSubscriber

Code

public function onRequestDeriveFormWrapper(GetResponseEvent $event) {
  $request = $event
    ->getRequest();
  if ($request->attributes
    ->has('_form')) {
    $request->attributes
      ->set('_controller', 'controller.form:getContentResult');
  }
}