You are here

public function JsResponse::setData in JS Callback Handler 8.3

Sets the data returned from a callback.

Parameters

mixed $data: The data to set.

Return value

$this

File

src/JsResponse.php, line 206

Class

JsResponse
JsResponse.

Namespace

Drupal\js

Code

public function setData($data = []) {
  $this->data = $data;
  $this
    ->setContent($this->data);
  return $this;
}