EarlyRenderingControllerWrapperSubscriber::onController

public EarlyRenderingControllerWrapperSubscriber::onController(FilterControllerEvent $event)

Ensures bubbleable metadata from early rendering is not lost.

Parameters

\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event: The controller event.

File

core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php, line 90

Class

EarlyRenderingControllerWrapperSubscriber
Subscriber that wraps controllers, to handle early rendering.

Namespace

Drupal\Core\EventSubscriber

Code

public function onController(FilterControllerEvent $event) {
  $controller = $event->getController();

  // See \Symfony\Component\HttpKernel\HttpKernel::handleRaw().
  $arguments = $this->controllerResolver->getArguments($event->getRequest(), $controller);

  $event->setController(function() use ($controller, $arguments) {
    return $this->wrapControllerExecutionInRenderContext($controller, $arguments);
  });
}
doc_Drupal
2016-10-29 09:03:29
Comments
Leave a Comment

Please login to continue.