AfterCommand.php 809 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Drupal\Core\Ajax;
  3. /**
  4. * An AJAX command for calling the jQuery after() method.
  5. *
  6. * The 'insert/after' command instructs the client to use jQuery's after()
  7. * method to insert the given HTML content after each element matched by the
  8. * given selector.
  9. *
  10. * This command is implemented by Drupal.AjaxCommands.prototype.insert()
  11. * defined in misc/ajax.js.
  12. *
  13. * @see http://docs.jquery.com/Manipulation/after#content
  14. *
  15. * @ingroup ajax
  16. */
  17. class AfterCommand extends InsertCommand {
  18. /**
  19. * Implements Drupal\Core\Ajax\CommandInterface:render().
  20. */
  21. public function render() {
  22. return [
  23. 'command' => 'insert',
  24. 'method' => 'after',
  25. 'selector' => $this->selector,
  26. 'data' => $this->getRenderedContent(),
  27. 'settings' => $this->settings,
  28. ];
  29. }
  30. }