Helper for simplifying JSON responses

package Default
inherited_from \Zend\View\Helper\AbstractHelper

 Methods

Encode data as JSON and set response header

__invoke(mixed $data, array $jsonOptions = array()) : 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\HelperInterface::getView()

Returns

null\Zend\View\Renderer\RendererInterface

Set the response object

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

Parameters

$response

\Zend\Http\Response

Returns

\Zend\View\Helper\Json

Set the View object

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

Parameters

$view

\Zend\View\Renderer\RendererInterface

Returns

\Zend\View\Helper\AbstractHelper

 Properties

 

$response

$response : \Zend\Http\Response

Default

 

View object instance

$view : \Zend\View\Renderer\RendererInterface

Default

null