Simplify AJAX context switching based on requested format
uses | |
---|---|
category | Zend |
package | Zend_Controller |
subpackage | Zend_Controller_Action_Helper |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Controller_Action_Helper_Abstract |
direct(mixed $data, boolean $sendNow= true
, boolean $keepLayouts= false
, boolean $encodeData= true
) : string | void
Allows encoding JSON. If $sendNow is true, immediately sends JSON response.
mixed
boolean
boolean
boolean
Encode $data as JSON?
string
void
encodeJson(mixed $data, boolean|array $keepLayouts= false
, boolean $encodeData= true
) : string
Encodes and returns data to JSON. Content-Type header set to 'application/json', and disables layouts and viewRenderer (if being used).
mixed
boolean
boolean
array
boolean
Provided data is already JSON 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 and/or 'encodeData'=>true|false that will not be passed to Zend_Json::encode method but will be passed to Zend_View_Helper_Json
\Zend_Controller_Action_Helper_Json |
---|
string
getActionController() : \Zend_Controller_Action
\Zend_Controller_Action
getFrontController() : \Zend_Controller_Front
\Zend_Controller_Front
getName() : string
string
getRequest() : \Zend_Controller_Request_Abstract
\Zend_Controller_Request_Abstract
$requestgetResponse() : \Zend_Controller_Response_Abstract
\Zend_Controller_Response_Abstract
$responseinit() : void
postDispatch() : void
preDispatch() : void
sendJson(mixed $data, boolean|array $keepLayouts= false
, $encodeData= true
) : string | void
mixed
boolean
array
Encode $data as JSON? 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 and/or 'encodeData'=>true|false that will not be passed to Zend_Json::encode method but will be passed to Zend_View_Helper_Json
string
void
setActionController(\Zend_Controller_Action $actionController = null
) : \Zend_Controller_ActionHelper_Abstract
\Zend_Controller_Action
\Zend_Controller_ActionHelper_Abstract
Provides a fluent interface$suppressExit : boolean
false
$_actionController : \Zend_Controller_Action
null
$_frontController : mixed
null