annotate core/lib/Drupal/Core/Ajax/RestripeCommand.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Ajax;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * AJAX command for resetting the striping on a table.
Chris@0 7 *
Chris@0 8 * The 'restripe' command instructs the client to restripe a table. This is
Chris@0 9 * usually used after a table has been modified by a replace or append command.
Chris@0 10 *
Chris@0 11 * This command is implemented by Drupal.AjaxCommands.prototype.restripe()
Chris@0 12 * defined in misc/ajax.js.
Chris@0 13 *
Chris@0 14 * @ingroup ajax
Chris@0 15 */
Chris@0 16 class RestripeCommand implements CommandInterface {
Chris@0 17
Chris@0 18 /**
Chris@0 19 * A CSS selector string.
Chris@0 20 *
Chris@0 21 * If the command is a response to a request from an #ajax form element then
Chris@0 22 * this value can be NULL.
Chris@0 23 *
Chris@0 24 * @var string
Chris@0 25 */
Chris@0 26 protected $selector;
Chris@0 27
Chris@0 28 /**
Chris@0 29 * Constructs a RestripeCommand object.
Chris@0 30 *
Chris@0 31 * @param string $selector
Chris@0 32 * A CSS selector for the table to be restriped.
Chris@0 33 */
Chris@0 34 public function __construct($selector) {
Chris@0 35 $this->selector = $selector;
Chris@0 36 }
Chris@0 37
Chris@0 38 /**
Chris@0 39 * Implements Drupal\Core\Ajax\CommandInterface:render().
Chris@0 40 */
Chris@0 41 public function render() {
Chris@0 42
Chris@0 43 return [
Chris@0 44 'command' => 'restripe',
Chris@0 45 'selector' => $this->selector,
Chris@0 46 ];
Chris@0 47 }
Chris@0 48
Chris@0 49 }