Helper for simplifying JSON responses

package Zend_View
subpackage Helper

 Methods

Encode data as JSON and set response header

__invoke(mixed $data, array $jsonOptions) : string | void

Parameters

$data

mixed

$jsonOptions

array

Options to pass to JsonFormatter::encode()

Returns

stringvoid

Get the view object

getView() : null | \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::getView()

Returns

Set the response object

setResponse(\Zend\Http\Response $response) : \Zend\View\Helper\Json

Parameters

Returns

Set the View object

setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::setView()

Parameters

Returns

 Properties

 

$response

$response : \Zend\Http\Response

 

View object

$view : \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::$$view