public static function JsonResponse::create

Factory method for chainability

Example:

return Response::create($body, 200) ->setSharedMaxAge(300);

Parameters

string $content The response content:

integer $status The response status code:

array $headers An array of response headers:

Return value

Response

Overrides Response::create

1 call to JsonResponse::create()
JsonResponseTest::testCreate in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php, line 41

Class

JsonResponse
Response represents an HTTP response in JSON format.

Namespace

Symfony\Component\HttpFoundation

Code

public static function create($data = array(), $status = 200, $headers = array()) {
  return new static($data, $status, $headers);
}