function Ajax::getInfo

Same name in other branches
  1. 9 core/lib/Drupal/Core/Render/Element/Ajax.php \Drupal\Core\Render\Element\Ajax::getInfo()
  2. 8.9.x core/lib/Drupal/Core/Render/Element/Ajax.php \Drupal\Core\Render\Element\Ajax::getInfo()
  3. 11.x core/lib/Drupal/Core/Render/Element/Ajax.php \Drupal\Core\Render\Element\Ajax::getInfo()

Overrides ElementInterface::getInfo

File

core/lib/Drupal/Core/Render/Element/Ajax.php, line 33

Class

Ajax
Provides a render element for adding Ajax to a render element.

Namespace

Drupal\Core\Render\Element

Code

public function getInfo() {
    // By default, we don't want Ajax commands being rendered in the context of
    // an HTML page, so we don't provide defaults for #theme or #theme_wrappers.
    // However, modules can set these properties (for example, to provide an
    // HTML debugging page that displays rather than executes Ajax commands).
    return [
        '#header' => TRUE,
        '#commands' => [],
        '#error' => NULL,
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.