function SettingsCommand::render

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Ajax/SettingsCommand.php \Drupal\Core\Ajax\SettingsCommand::render()
  2. 8.9.x core/lib/Drupal/Core/Ajax/SettingsCommand.php \Drupal\Core\Ajax\SettingsCommand::render()
  3. 10 core/lib/Drupal/Core/Ajax/SettingsCommand.php \Drupal\Core\Ajax\SettingsCommand::render()

Implements Drupal\Core\Ajax\CommandInterface:render().

Overrides CommandInterface::render

File

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

Class

SettingsCommand
AJAX command for adjusting Drupal's JavaScript settings.

Namespace

Drupal\Core\Ajax

Code

public function render() {
    if (isset($this->settings['ajax_page_state']['libraries'])) {
        $this->settings['ajax_page_state']['libraries'] = UrlHelper::compressQueryParameter($this->settings['ajax_page_state']['libraries']);
    }
    return [
        'command' => 'settings',
        'settings' => $this->settings,
        'merge' => $this->merge,
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.