Helper for simplifying JSON responses

package Zend_View
subpackage Helper
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_View_Helper_Abstract

 Methods

Strategy pattern: currently unutilized

direct() : void
Inherited
inherited_from \Zend_View_Helper_Interface::direct()

Encode data as JSON, disable layouts, and set response header

json(mixed $data, boolean $keepLayouts = false, boolean $encodeData = true) : string | void

If $keepLayouts is true, does not disable layouts. If $encodeJson is false, does not JSON-encode $data

Parameters

$data

mixed

$keepLayouts

boolean

NOTE: if boolean, establish $keepLayouts to true|false if array, admit params for Zend_Json::encode as enableJsonExprFinder=>true|false this array can contains a 'keepLayout'=>true|false and/or 'encodeData'=>true|false that will not be passed to Zend_Json::encode method but will be used here

$encodeData

boolean

Returns

stringvoid

Set the View object

setView(\Zend_View_Interface $view) : \Zend_View_Helper_Abstract
Inherited
inherited_from \Zend_View_Helper_Interface::setView()

Parameters

$view

\Zend_View_Interface

Returns

\Zend_View_Helper_Abstract

 Properties

 

View object

$view : \Zend_View_Interface

Default

null