Returns a JsonResponse that uses the serializer component if enabled, or json_encode.
protected json ( mixed $data, integer $status = 200, array $headers = [], array $context = [] ) : Symfony\Component\HttpFoundation\JsonResponse | ||
$data | mixed | The response data |
$status | integer | The status code to use for the Response |
$headers | array | Array of extra headers to add |
$context | array | Context to pass to serializer when using serializer component |
Résultat | Symfony\Component\HttpFoundation\JsonResponse |
public function json($data, $status = 200, $headers = array(), $context = array()) { return parent::json($data, $status, $headers, $context); }