BeforeCommand.php

Definition of Drupal\Core\Ajax\InsertCommand.

Namespace

Drupal\Core\Ajax

File

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

Classes

Namesort descending Description
BeforeCommand An AJAX command for calling the jQuery before() method.