function AddJsCommand::render

Same name in other branches
  1. 9 core/lib/Drupal/Core/Ajax/AddJsCommand.php \Drupal\Core\Ajax\AddJsCommand::render()
  2. 11.x core/lib/Drupal/Core/Ajax/AddJsCommand.php \Drupal\Core\Ajax\AddJsCommand::render()

Overrides CommandInterface::render

File

core/lib/Drupal/Core/Ajax/AddJsCommand.php, line 53

Class

AddJsCommand
An AJAX command for adding JS to the page via AJAX.

Namespace

Drupal\Core\Ajax

Code

public function render() {
    return [
        'command' => 'add_js',
        'selector' => $this->selector,
        'data' => $this->scripts,
    ];
}

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