API Documentation

Controller/Action/Helper/Json.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Controller
subpackage
Zend_Controller_Action_Helper
version
$Id: Json.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Controller_Action_Helper_Json

Description

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 license@zend.com so we can send you a copy immediately.

Zend_Controller_Action_Helper_Json

Extends from
Zend_Controller_Action_Helper_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Controller
subpackage
Zend_Controller_Action_Helper
uses
Zend_Controller_Action_Helper_Abstract
Properties
$suppressExit
Methods
encodeJson
sendJson
direct

Description

Simplify AJAX context switching based on requested format

Properties

$suppressExit

boolean $suppressExit = 'false'

Suppress exit when sendJson() called

Details

$suppressExit
boolean
visibility
public
default
false
final
false
static
false

Methods

direct

direct( mixed $data, boolean $sendNow = true, boolean $keepLayouts = false ) : string|void

Strategy pattern: call helper as helper broker method

Allows encoding JSON. If $sendNow is true, immediately sends JSON response.

Arguments
$data
mixed
$sendNow
boolean
$keepLayouts
boolean
Output
string|void
Details
visibility
public
final
false
static
false

encodeJson

encodeJson( mixed $data, boolean|boolean|array $keepLayouts = false ) : string

Create JSON response

Encodes and returns data to JSON. Content-Type header set to 'application/json', and disables layouts and viewRenderer (if being used).

Arguments
$data
mixed
$keepLayouts
booleanbooleanarray
Output
string
Details
visibility
public
final
false
static
false
throws

sendJson

sendJson( mixed $data, boolean|array $keepLayouts = false ) : string|void

Encode JSON response and immediately send

Arguments
$data
mixed
$keepLayouts
booleanarray
NOTE: if boolean, establish $keepLayouts to true|false if array, admit params for Zend_Json::encode as enableJsonExprFinder=>true|false if $keepLayouts and parmas for Zend_Json::encode are required then, the array can contains a 'keepLayout'=>true|false that will not be passed to Zend_Json::encode method but will be passed to Zend_View_Helper_Json
Output
string|void
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.