You are here

public function FormTestEventSubscriber::onKernelResponse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/form_test/src/EventSubscriber/FormTestEventSubscriber.php \Drupal\form_test\EventSubscriber\FormTestEventSubscriber::onKernelResponse()

Adds custom headers to the response.

Parameters

\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The kernel request event.

File

core/modules/system/tests/modules/form_test/src/EventSubscriber/FormTestEventSubscriber.php, line 38
Contains \Drupal\form_test\EventSubscriber\FormTestEventSubscriber.

Class

FormTestEventSubscriber
Test event subscriber to add new attributes to the request.

Namespace

Drupal\form_test\EventSubscriber

Code

public function onKernelResponse(FilterResponseEvent $event) {
  $response = $event
    ->getResponse();
  $response->headers
    ->set('X-Form-Test-Response-Event', 'invoked');
}