[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/symfony/http-foundation/ -> JsonResponse.php (summary)

(no description)

File Size: 218 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

JsonResponse:: (7 methods):
  __construct()
  create()
  setCallback()
  setData()
  getEncodingOptions()
  setEncodingOptions()
  update()


Class: JsonResponse  - X-Ref

Response represents an HTTP response in JSON format.

Note that this class does not force the returned JSON content to be an
object. It is however recommended that you do return an object as it
protects yourself against XSSI and JSON-JavaScript Hijacking.

__construct($data = null, $status = 200, $headers = array()   X-Ref

param: mixed $data    The response data
param: int   $status  The response status code
param: array $headers An array of response headers

create($data = null, $status = 200, $headers = array()   X-Ref
Factory method for chainability.

Example:

return JsonResponse::create($data, 200)
->setSharedMaxAge(300);

param: mixed $data    The json response data
param: int   $status  The response status code
param: array $headers An array of response headers
return: static

setCallback($callback = null)   X-Ref
Sets the JSONP callback.

param: string|null $callback The JSONP callback or null to use none
return: $this

setData($data = array()   X-Ref
Sets the data to be sent as JSON.

param: mixed $data
return: $this

getEncodingOptions()   X-Ref
Returns options used while encoding data to JSON.

return: int

setEncodingOptions($encodingOptions)   X-Ref
Sets options used while encoding data to JSON.

param: int $encodingOptions
return: $this

update()   X-Ref
Updates the content and headers according to the JSON data and callback.

return: $this



Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1