You are here

protected function ChooseBlockController::getAjaxAttributes in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Controller/ChooseBlockController.php \Drupal\layout_builder\Controller\ChooseBlockController::getAjaxAttributes()
  2. 9 core/modules/layout_builder/src/Controller/ChooseBlockController.php \Drupal\layout_builder\Controller\ChooseBlockController::getAjaxAttributes()

Get dialog attributes if an ajax request.

Return value

array The attributes array.

3 calls to ChooseBlockController::getAjaxAttributes()
ChooseBlockController::build in core/modules/layout_builder/src/Controller/ChooseBlockController.php
Provides the UI for choosing a new block.
ChooseBlockController::getBlockLinks in core/modules/layout_builder/src/Controller/ChooseBlockController.php
Gets a render array of block links.
ChooseBlockController::inlineBlockList in core/modules/layout_builder/src/Controller/ChooseBlockController.php
Provides the UI for choosing a new inline block.

File

core/modules/layout_builder/src/Controller/ChooseBlockController.php, line 256

Class

ChooseBlockController
Defines a controller to choose a new block.

Namespace

Drupal\layout_builder\Controller

Code

protected function getAjaxAttributes() {
  if ($this
    ->isAjax()) {
    return [
      'class' => [
        'use-ajax',
      ],
      'data-dialog-type' => 'dialog',
      'data-dialog-renderer' => 'off_canvas',
    ];
  }
  return [];
}