You are here

public function HtmlResponseSubscriber::onRespond in Zircon Profile 8

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

Processes attachments for HtmlResponse responses.

Parameters

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

File

core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php, line 44
Contains \Drupal\Core\EventSubscriber\HtmlResponseSubscriber.

Class

HtmlResponseSubscriber
Response subscriber to handle HTML responses.

Namespace

Drupal\Core\EventSubscriber

Code

public function onRespond(FilterResponseEvent $event) {
  $response = $event
    ->getResponse();
  if (!$response instanceof HtmlResponse) {
    return;
  }
  $event
    ->setResponse($this->htmlResponseAttachmentsProcessor
    ->processAttachments($response));
}