You are here

protected function SimpleBlockAddControllerSubscriber::getAttributes in Simple Block 8

Get links attributes.

Return value

array The attributes array.

1 call to SimpleBlockAddControllerSubscriber::getAttributes()
SimpleBlockAddControllerSubscriber::alterBuild in modules/simple_block_layout_builder/src/Event/Subscriber/SimpleBlockAddControllerSubscriber.php
Alters the build produced by ChooseBlockController::build().

File

modules/simple_block_layout_builder/src/Event/Subscriber/SimpleBlockAddControllerSubscriber.php, line 118

Class

SimpleBlockAddControllerSubscriber
Alters the render array of Layout Builder ChooseBlockController::build().

Namespace

Drupal\simple_block_layout_builder\Event\Subscriber

Code

protected function getAttributes() : array {
  $attributes = [
    'class' => [
      'inline-block-create-button',
    ],
  ];
  if ($this
    ->isAjax()) {
    $attributes = NestedArray::mergeDeep($attributes, [
      'class' => [
        'use-ajax',
      ],
      'data-dialog-type' => 'dialog',
      'data-dialog-renderer' => 'off_canvas',
    ]);
  }
  return $attributes;
}