Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
Json Class Reference

Helper for simplifying JSON responses. More...

Public Member Functions

 __invoke ($data, array $jsonOptions=[])
 Encode data as JSON and set response header.
 
 setResponse (Response $response)
 Set the response object.
 
- Public Member Functions inherited from AbstractHelper
 setView (Renderer $view)
 Set the View object.
 
 getView ()
 Get the view object.
 

Protected Attributes

 $response
 
- Protected Attributes inherited from AbstractHelper
 $view = null
 

Detailed Description

Helper for simplifying JSON responses.

Member Function Documentation

__invoke (   $data,
array  $jsonOptions = [] 
)

Encode data as JSON and set response header.

Parameters
mixed$data
array$jsonOptionsOptions to pass to JsonFormatter::encode()
Returns
string|void
setResponse ( Response  $response)

Set the response object.

Parameters
Response$response
Returns
Json

Member Data Documentation

$response
protected