You are here

public static function AjaxFormTrait::getAjaxAttributes in Context 8

Same name and namespace in other branches
  1. 8.4 src/Form/AjaxFormTrait.php \Drupal\context\Form\AjaxFormTrait::getAjaxAttributes()
  2. 8.0 src/Form/AjaxFormTrait.php \Drupal\context\Form\AjaxFormTrait::getAjaxAttributes()

Gets attributes for use with an AJAX modal.

Return value

array

3 calls to AjaxFormTrait::getAjaxAttributes()
AjaxFormTrait::getAjaxButtonAttributes in src/Form/AjaxFormTrait.php
Gets attributes for use with an add button AJAX modal.
Blocks::buildConfigurationForm in src/Plugin/ContextReaction/Blocks.php
Form constructor.
ContextListBuilder::buildForm in modules/context_ui/src/ContextListBuilder.php
Form constructor.

File

src/Form/AjaxFormTrait.php, line 24
Contains \Drupal\context\Form\AjaxFormTrait.

Class

AjaxFormTrait
Provides helper methods for using an AJAX modal. This is a copy of the ctools AjaxFormTrait.

Namespace

Drupal\context\Form

Code

public static function getAjaxAttributes() {
  return [
    'class' => [
      'use-ajax',
    ],
    'data-dialog-type' => 'modal',
    'data-dialog-options' => Json::encode([
      'width' => 1000,
    ]),
  ];
}