Class JsonResponse
Response represents an HTTP response in JSON format.
-
Symfony\Component\HttpFoundation\Response
-
Symfony\Component\HttpFoundation\JsonResponse
Methods summary
public
|
#
__construct( mixed $data = null, integer $status = 200, array $headers = array() )
Constructor.
Parameters
- $data
mixed $data The response data
- $status
integer $status The response status code
- $headers
array $headers An array of response headers
Throws
Overrides
|
public static
Symfony\Component\HttpFoundation\Response
|
#
create( string $data = null, integer $status = 200, array $headers = array() )
Factory method for chainability
Factory method for chainability
Parameters
- $data
string $content The response content
- $status
integer $status The response status code
- $headers
array $headers An array of response headers
Returns
Overrides
|
public
Symfony\Component\HttpFoundation\JsonResponse
|
#
setCallback( string $callback = null )
Sets the JSONP callback.
Parameters
- $callback
string $callback
Returns
Throws
|
public
Symfony\Component\HttpFoundation\JsonResponse
|
#
setData( mixed $data = array() )
Sets the data to be sent as json.
Sets the data to be sent as json.
Parameters
Returns
|
protected
Symfony\Component\HttpFoundation\JsonResponse
|
#
update( )
Updates the content and headers according to the json data and callback.
Updates the content and headers according to the json data and callback.
Returns
|
Methods inherited from Symfony\Component\HttpFoundation\Response
__clone(),
__toString(),
expire(),
getAge(),
getCharset(),
getContent(),
getDate(),
getEtag(),
getExpires(),
getLastModified(),
getMaxAge(),
getProtocolVersion(),
getStatusCode(),
getTtl(),
getVary(),
hasVary(),
isCacheable(),
isClientError(),
isEmpty(),
isForbidden(),
isFresh(),
isInformational(),
isInvalid(),
isNotFound(),
isNotModified(),
isOk(),
isRedirect(),
isRedirection(),
isServerError(),
isSuccessful(),
isValidateable(),
mustRevalidate(),
prepare(),
send(),
sendContent(),
sendHeaders(),
setCache(),
setCharset(),
setClientTtl(),
setContent(),
setDate(),
setEtag(),
setExpires(),
setLastModified(),
setMaxAge(),
setNotModified(),
setPrivate(),
setProtocolVersion(),
setPublic(),
setSharedMaxAge(),
setStatusCode(),
setTtl(),
setVary()
|