Ajax.php 759 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Drupal\Core\Render\Element;
  3. /**
  4. * Provides a render element for adding Ajax to a render element.
  5. *
  6. * Holds an array whose values control the Ajax behavior of the element.
  7. *
  8. * @ingroup ajax
  9. *
  10. * @RenderElement("ajax")
  11. */
  12. class Ajax extends RenderElement {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function getInfo() {
  17. // By default, we don't want Ajax commands being rendered in the context of
  18. // an HTML page, so we don't provide defaults for #theme or #theme_wrappers.
  19. // However, modules can set these properties (for example, to provide an
  20. // HTML debugging page that displays rather than executes Ajax commands).
  21. return [
  22. '#header' => TRUE,
  23. '#commands' => [],
  24. '#error' => NULL,
  25. ];
  26. }
  27. }