Chris@0: htmlResponseAttachmentsProcessor = $html_response_attachments_processor; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Processes attachments for HtmlResponse responses. Chris@0: * Chris@0: * @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event Chris@0: * The event to process. Chris@0: */ Chris@0: public function onRespond(FilterResponseEvent $event) { Chris@0: $response = $event->getResponse(); Chris@0: if (!$response instanceof HtmlResponse) { Chris@0: return; Chris@0: } Chris@0: Chris@0: $event->setResponse($this->htmlResponseAttachmentsProcessor->processAttachments($response)); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public static function getSubscribedEvents() { Chris@0: $events[KernelEvents::RESPONSE][] = ['onRespond']; Chris@0: return $events; Chris@0: } Chris@0: Chris@0: }