Class Zend_Controller_Action_Helper_Json

Description

Simplify AJAX context switching based on requested format

Located in /Controller/Action/Helper/Json.php (line 38)

Zend_Controller_Action_Helper_Abstract
   |
   --Zend_Controller_Action_Helper_Json
Variable Summary
 boolean $suppressExit
Method Summary
 string|void direct (mixed $data, [boolean $sendNow = true], [boolean $keepLayouts = false])
 string encodeJson (mixed $data, [boolean|array $keepLayouts = false])
 string|void sendJson (mixed $data, [boolean|array $keepLayouts = false])
Variables
boolean $suppressExit = false (line 44)

Suppress exit when sendJson() called

  • access: public

Inherited Variables

Inherited from Zend_Controller_Action_Helper_Abstract

Zend_Controller_Action_Helper_Abstract::$_actionController
Zend_Controller_Action_Helper_Abstract::$_frontController
Methods
direct (line 123)

Strategy pattern: call helper as helper broker method

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

  • access: public
string|void direct (mixed $data, [boolean $sendNow = true], [boolean $keepLayouts = false])
  • mixed $data
  • boolean $sendNow
  • boolean $keepLayouts
encodeJson (line 65)

Create JSON response

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

  • throws: Zend_Controller_Action_Helper_Json
  • access: public
string encodeJson (mixed $data, [boolean|array $keepLayouts = false])
  • mixed $data
  • boolean|array $keepLayouts: 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
sendJson (line 98)

Encode JSON response and immediately send

  • access: public
string|void sendJson (mixed $data, [boolean|array $keepLayouts = false])
  • mixed $data
  • boolean|array $keepLayouts: 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

Inherited Methods

Inherited From Zend_Controller_Action_Helper_Abstract

 Zend_Controller_Action_Helper_Abstract::getActionController()
 Zend_Controller_Action_Helper_Abstract::getFrontController()
 Zend_Controller_Action_Helper_Abstract::getName()
 Zend_Controller_Action_Helper_Abstract::getRequest()
 Zend_Controller_Action_Helper_Abstract::getResponse()
 Zend_Controller_Action_Helper_Abstract::init()
 Zend_Controller_Action_Helper_Abstract::postDispatch()
 Zend_Controller_Action_Helper_Abstract::preDispatch()
 Zend_Controller_Action_Helper_Abstract::setActionController()

Documentation generated on Mon, 21 Jun 2010 15:30:21 -0400 by phpDocumentor 1.4.3