class AjaxResponseSubscriber implements EventSubscriberInterface (View source)

Response subscriber to handle AJAX responses.

Constants

AJAX_REQUEST_PARAMETER

Request parameter to indicate that a request is a Drupal Ajax request.

Properties

protected AttachmentsResponseProcessorInterface $ajaxResponseAttachmentsProcessor

The AJAX response attachments processor service.

Methods

__construct(AttachmentsResponseProcessorInterface $ajax_response_attachments_processor)

Constructs an AjaxResponseSubscriber object.

onRequest(RequestEvent $event)

Sets the AJAX parameter from the current request.

onResponse(ResponseEvent $event)

Renders the ajax commands right before preparing the result.

static 
getSubscribedEvents()

{@inheritdoc}

Details

__construct(AttachmentsResponseProcessorInterface $ajax_response_attachments_processor)

Constructs an AjaxResponseSubscriber object.

Parameters

AttachmentsResponseProcessorInterface $ajax_response_attachments_processor

The AJAX response attachments processor service.

onRequest(RequestEvent $event)

Sets the AJAX parameter from the current request.

Parameters

RequestEvent $event

The response event, which contains the current request.

onResponse(ResponseEvent $event)

Renders the ajax commands right before preparing the result.

Parameters

ResponseEvent $event

The response event, which contains the possible AjaxResponse object.

static getSubscribedEvents()

{@inheritdoc}