You are here

interface CommandInterface in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Ajax/CommandInterface.php \Drupal\Core\Ajax\CommandInterface
  2. 10 core/lib/Drupal/Core/Ajax/CommandInterface.php \Drupal\Core\Ajax\CommandInterface

AJAX command interface.

All AJAX commands passed to AjaxResponse objects should implement these methods.

Hierarchy

Expanded class hierarchy of CommandInterface

All classes that implement CommandInterface

Related topics

11 files declare their use of CommandInterface
AddStyleSheetCommand.php in core/modules/ckeditor/src/Ajax/AddStyleSheetCommand.php
EditorDialogSave.php in core/modules/editor/src/Ajax/EditorDialogSave.php
HighlightCommand.php in core/modules/views/src/Ajax/HighlightCommand.php
JsAjaxTestCommand.php in core/modules/system/tests/modules/js_ajax_test/src/Ajax/JsAjaxTestCommand.php
ReplaceTitleCommand.php in core/modules/views/src/Ajax/ReplaceTitleCommand.php

... See full list

File

core/lib/Drupal/Core/Ajax/CommandInterface.php, line 13

Namespace

Drupal\Core\Ajax
View source
interface CommandInterface {

  /**
   * Return an array to be run through json_encode and sent to the client.
   */
  public function render();

}

Members

Namesort descending Modifiers Type Description Overrides
CommandInterface::render public function Return an array to be run through json_encode and sent to the client. 30