class HighlightCommand

Provides an AJAX command for highlighting a certain new piece of html.

This command is implemented in Drupal.AjaxCommands.prototype.viewsHighlight.

Hierarchy

Expanded class hierarchy of HighlightCommand

1 file declares its use of HighlightCommand
ajax.inc in drupal/core/modules/views/includes/ajax.inc
Handles the server side AJAX interactions of Views.

File

drupal/core/modules/views/lib/Drupal/views/Ajax/HighlightCommand.php, line 17
Contains \Drupal\views\Ajax\HighlightCommand.

Namespace

Drupal\views\Ajax
View source
class HighlightCommand implements CommandInterface {

  /**
   * A CSS selector string.
   *
   * @var string
   */
  protected $selector;

  /**
   * Constructs a \Drupal\views\Ajax\HighlightCommand object.
   *
   * @param string $selector
   *   A CSS selector.
   */
  public function __construct($selector) {
    $this->selector = $selector;
  }

  /**
   * Implements \Drupal\Core\Ajax\CommandInterface::render().
   */
  public function render() {
    return array(
      'command' => 'viewsHighlight',
      'selector' => $this->selector,
    );
  }

}

Members