class Ajax
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Render/Element/Ajax.php \Drupal\Core\Render\Element\Ajax
- 10 core/lib/Drupal/Core/Render/Element/Ajax.php \Drupal\Core\Render\Element\Ajax
- 11.x core/lib/Drupal/Core/Render/Element/Ajax.php \Drupal\Core\Render\Element\Ajax
Provides a render element for adding Ajax to a render element.
Holds an array whose values control the Ajax behavior of the element.
Plugin annotation
@RenderElement("ajax");
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\Core\Render\Element\RenderElement extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Render\Element\ElementInterface
- class \Drupal\Core\Render\Element\Ajax extends \Drupal\Core\Render\Element\RenderElement
- class \Drupal\Core\Render\Element\RenderElement extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Render\Element\ElementInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of Ajax
Related topics
14 string references to 'Ajax'
- AjaxRenderer::renderResponse in core/
lib/ Drupal/ Core/ Render/ MainContent/ AjaxRenderer.php - Renders the main content render array into a response.
- DisplayPluginBase::buildOptionsForm in core/
modules/ views/ src/ Plugin/ views/ display/ DisplayPluginBase.php - Provide a form to edit options for this plugin.
- EntitySerializationTest::testSerialize in core/
modules/ serialization/ tests/ src/ Kernel/ EntitySerializationTest.php - Tests entity serialization for core's formats by a registered Serializer.
- ExposedFormPluginBase::renderExposedForm in core/
modules/ views/ src/ Plugin/ views/ exposed_form/ ExposedFormPluginBase.php - Renders the exposed form.
- FormBuilderTest::testGetPostAjaxRequest in core/
tests/ Drupal/ Tests/ Core/ Form/ FormBuilderTest.php - @covers ::buildForm
File
-
core/
lib/ Drupal/ Core/ Render/ Element/ Ajax.php, line 14
Namespace
Drupal\Core\Render\ElementView source
class Ajax extends RenderElement {
/**
* {@inheritdoc}
*/
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,
];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
Ajax::getInfo | public | function | Returns the element properties for this element. | Overrides ElementInterface::getInfo | |
PluginInspectionInterface::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | 6 | |
PluginInspectionInterface::getPluginId | public | function | Gets the plugin_id of the plugin instance. | 2 | |
RenderElement::preRenderAjaxForm | public static | function | Adds Ajax information about an element to communicate with JavaScript. | ||
RenderElement::preRenderGroup | public static | function | Adds members of this group as actual elements for rendering. | ||
RenderElement::processAjaxForm | public static | function | Form element processing handler for the #ajax form property. | 1 | |
RenderElement::processGroup | public static | function | Arranges elements into groups. | ||
RenderElement::setAttributes | public static | function | Sets a form element's class attribute. | Overrides ElementInterface::setAttributes |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.