Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AjaxResponseSubscriber.php

function AjaxResponseSubscriber::onRequest

Sets the AJAX parameter from the current request.

Parameters

\Symfony\Component\HttpKernel\Event\RequestEvent $event: The response event, which contains the current request.

File

core/lib/Drupal/Core/EventSubscriber/AjaxResponseSubscriber.php, line 40

Class

AjaxResponseSubscriber
Response subscriber to handle AJAX responses.

Namespace

Drupal\Core\EventSubscriber

Code

public function onRequest(RequestEvent $event) {
    // Pass to the Html class that the current request is an Ajax request.
    if ($event->getRequest()
        ->get(static::AJAX_REQUEST_PARAMETER)) {
        Html::setIsAjax(TRUE);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal