You are here

public function CsvSubscriber::onKernelRequest in CSV Serialization 8

Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/CsvSubscriber.php \Drupal\csv_serialization\EventSubscriber\CsvSubscriber::onKernelRequest()

Register content type formats on the request object.

Parameters

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

File

src/EventSubscriber/CsvSubscriber.php, line 20

Class

CsvSubscriber
Event subscriber for adding CSV content types to the request.

Namespace

Drupal\csv_serialization\EventSubscriber

Code

public function onKernelRequest(GetResponseEvent $event) {
  $event
    ->getRequest()
    ->setFormat('csv', [
    'text/csv',
  ]);
}