You are here

public function SetSubtreesCommand::render in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/toolbar/src/Ajax/SetSubtreesCommand.php \Drupal\toolbar\Ajax\SetSubtreesCommand::render()

Return an array to be run through json_encode and sent to the client.

Overrides CommandInterface::render

File

core/modules/toolbar/src/Ajax/SetSubtreesCommand.php, line 37
Contains \Drupal\toolbar\Ajax\SetSubtreesCommand.

Class

SetSubtreesCommand
Defines an AJAX command that sets the toolbar subtrees.

Namespace

Drupal\toolbar\Ajax

Code

public function render() {
  return [
    'command' => 'setToolbarSubtrees',
    'subtrees' => array_map('strval', $this->subtrees),
  ];
}