View/Helper/Json.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_View
- Subpackage
- Helper
- Version
- $Id: Json.php 25091 2012-11-07 19:58:48Z rob $
\Zend_View_Helper_Json
Helper for simplifying JSON responses
- Parent(s)
- \Zend_View_Helper_Abstract
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

\Zend_View_Interface $view = null
nullDetails- Type
- \Zend_View_Interface
- Inherited_from
- \Zend_View_Helper_Abstract::$$view
Methods

direct() : voidStrategy pattern: currently unutilized
Inherited from: \Zend_View_Helper_Abstract::direct()
json(mixed $data, bool $keepLayouts = false, bool $encodeData = true) : string | voidEncode data as JSON, disable layouts, and set response header
If $keepLayouts is true, does not disable layouts. If $encodeJson is false, does not JSON-encode $data
| Name | Type | Description |
|---|---|---|
| $data | mixed | |
| $keepLayouts | bool | 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 | bool |
| Type | Description |
|---|---|
| string | void |

setView(\Zend_View_Interface $view) : \Zend_View_Helper_Abstract
| Name | Type | Description |
|---|---|---|
| $view | \Zend_View_Interface |
| Type | Description |
|---|---|
| \Zend_View_Helper_Abstract |