Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. JsonResponse.php

function JsonResponse::setJson

Sets a raw string containing a JSON document to be sent.

Return value

$this

2 calls to JsonResponse::setJson()
JsonResponse::setData in vendor/symfony/http-foundation/JsonResponse.php
Sets the data to be sent as JSON.
JsonResponse::__construct in vendor/symfony/http-foundation/JsonResponse.php

File

vendor/symfony/http-foundation/JsonResponse.php, line 109

Class

JsonResponse
Response represents an HTTP response in JSON format.

Namespace

Symfony\Component\HttpFoundation

Code

public function setJson(string $json) : static {
    $this->data = $json;
    return $this->update();
}
RSS feed
Powered by Drupal