public function JsonResponse::__construct

Constructor.

Parameters

mixed $data The response data:

integer $status The response status code:

array $headers An array of response headers:

Overrides Response::__construct

File

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

Class

JsonResponse
Response represents an HTTP response in JSON format.

Namespace

Symfony\Component\HttpFoundation

Code

public function __construct($data = array(), $status = 200, $headers = array()) {
  parent::__construct('', $status, $headers);
  $this
    ->setData($data);
}