class SettingsCommand

AJAX command for adjusting Drupal's JavaScript settings.

The 'settings' command instructs the client either to use the given array as the settings for ajax-loaded content or to extend drupalSettings with the given array, depending on the value of the $merge parameter.

This command is implemented by Drupal.AjaxCommands.prototype.settings() defined in misc/ajax.js.

Hierarchy

Related topics

Ajax API
Overview for Drupal's Ajax API.

File

core/lib/Drupal/Core/Ajax/SettingsCommand.php, line 17

Namespace

Drupal\Core\Ajax

Members

Name Modifiers Type Description
SettingsCommand::$merge protected property Whether the settings should be merged into the global drupalSettings.
SettingsCommand::$settings protected property An array of key/value pairs of JavaScript settings.
SettingsCommand::render public function Implements Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface::render
SettingsCommand::__construct public function Constructs a SettingsCommand object.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Ajax!SettingsCommand.php/class/SettingsCommand/8.1.x