Mercurial > hg > isophonics-drupal-site
view core/lib/Drupal/Core/Ajax/BaseCommand.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
<?php namespace Drupal\Core\Ajax; /** * Base command that only exists to simplify AJAX commands. */ class BaseCommand implements CommandInterface { /** * The name of the command. * * @var string */ protected $command; /** * The data to pass on to the client side. * * @var string */ protected $data; /** * Constructs a BaseCommand object. * * @param string $command * The name of the command. * @param string $data * The data to pass on to the client side. */ public function __construct($command, $data) { $this->command = $command; $this->data = $data; } /** * {@inheritdoc} */ public function render() { return [ 'command' => $this->command, 'data' => $this->data, ]; } }