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

Breadcrumb

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

function AjaxHelperTrait::isAjax

Determines if the current request is via AJAX.

Return value

bool TRUE if the current request is via AJAX, FALSE otherwise.

9 calls to AjaxHelperTrait::isAjax()
AddSectionController::build in core/modules/layout_builder/src/Controller/AddSectionController.php
Adds the new section.
ChooseBlockController::getAjaxAttributes in core/modules/layout_builder/src/Controller/ChooseBlockController.php
Get dialog attributes if an ajax request.
ChooseSectionController::build in core/modules/layout_builder/src/Controller/ChooseSectionController.php
Choose a layout plugin to add as a section.
ConfigureBlockFormBase::doBuildForm in core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php
Builds the form for the block.
ConfigureSectionForm::buildForm in core/modules/layout_builder/src/Form/ConfigureSectionForm.php
Form constructor.

... See full list

File

core/lib/Drupal/Core/Ajax/AjaxHelperTrait.php, line 20

Class

AjaxHelperTrait
Provides a helper to determine if the current request is via AJAX.

Namespace

Drupal\Core\Ajax

Code

protected function isAjax() {
    $wrapper_format = $this->getRequestWrapperFormat() ?? '';
    return str_contains($wrapper_format, 'drupal_ajax') || str_contains($wrapper_format, 'drupal_modal') || str_contains($wrapper_format, 'drupal_dialog');
}

API Navigation

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