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_ContextSwitch |
__construct() : void
Add HTML context
inherited_from | \Zend_Controller_Action_Helper_ContextSwitch::__construct() |
---|
__construct(array|\Zend_Config $options = null
) : void
array
\Zend_Config
addActionContext(string $action, string|array $context) : \Zend_Controller_Action_Helper_ContextSwitch | void
string
string
array
\Zend_Controller_Action_Helper_ContextSwitch
void
Provides a fluent interfaceaddActionContexts(array $contexts) : \Zend_Controller_Action_Helper_ContextSwitch
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfaceaddContext(string $context, array $spec) : \Zend_Controller_Action_Helper_ContextSwitch
string
Context type
array
Context specification
\Zend_Controller_Action_Exception |
---|
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfaceaddContexts(array $contexts) : \Zend_Controller_Action_Helper_ContextSwitch
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfaceaddHeader(string $context, string $header, string $content) : \Zend_Controller_Action_Helper_ContextSwitch
string
string
string
\Zend_Controller_Action_Exception |
---|
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfaceaddHeaders(string $context, array $headers) : \Zend_Controller_Action_Helper_ContextSwitch
string
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfaceclearActionContexts(string $action = null
) : \Zend_Controller_Action_Helper_ContextSwitch
string
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfaceclearCallbacks(string $context) : \Zend_Controller_Action_Helper_ContextSwitch
string
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfaceclearContexts() : \Zend_Controller_Action_Helper_ContextSwitch
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfaceclearHeaders(string $context) : \Zend_Controller_Action_Helper_ContextSwitch
string
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacedirect() : \Zend_Controller_Action_Helper_ContextSwitch
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacegetActionContexts(string $action = null
) : array
string
array
getActionController() : \Zend_Controller_Action
\Zend_Controller_Action
getAutoDisableLayout() : boolean
boolean
getAutoJsonSerialization() : boolean
boolean
getCallback(string $context, string $trigger) : string | array | null
string
string
string
array
null
getCallbacks(string $context) : array
string
array
getContext(string $context) : array | null
string
array
null
getContextParam() : string
string
getContexts() : array
array
getCurrentContext() : null | string
null
string
getDefaultContext() : string
string
getFrontController() : \Zend_Controller_Front
\Zend_Controller_Front
getHeader(string $context, string $header) : string | null
Returns the value of a given header for a given context type
string
string
string
null
getHeaders(string $context) : array
Returns all headers for a context as key/value pairs
string
array
getName() : string
string
getRequest() : \Zend_Controller_Request_Abstract
\Zend_Controller_Request_Abstract
$requestgetResponse() : \Zend_Controller_Response_Abstract
\Zend_Controller_Response_Abstract
$responsegetSuffix(string $type) : string
string
Context type
\Zend_Controller_Action_Exception |
---|
string
hasActionContext(string $action, string|array $context) : boolean
string
string
array
\Zend_Controller_Action_Exception |
---|
boolean
hasContext(string $context, boolean $throwException = false
) : boolean
string
boolean
\Zend_Controller_Action_Exception |
if context does not exist and throwException is true |
---|
boolean
init() : void
initContext(string $format = null
) : void
Checks for XHR requests; if detected, attempts to perform context switch.
inherited_from | \Zend_Controller_Action_Helper_ContextSwitch::initContext() |
---|
string
initContext(mixed $format = null
) : void
mixed
\Zend_Controller_Action_Exception |
---|
initJsonContext() : void
Turns off viewRenderer auto-rendering
postDispatch() : void
postJsonContext() : void
JSON serialize view variables to response body
preDispatch() : void
removeActionContext(string $action, string|array $context) : boolean
string
string
array
boolean
removeCallback(string $context, string $trigger) : boolean
string
string
boolean
removeContext(string $context) : boolean
string
boolean
removeHeader(string $context, string $header) : boolean
string
string
boolean
setActionContext(string $action, string|array $context) : \Zend_Controller_Action_Helper_ContextSwitch | void
string
string
array
\Zend_Controller_Action_Helper_ContextSwitch
void
Provides a fluent interfacesetActionContexts(array $contexts) : \Zend_Controller_Action_Helper_ContextSwitch
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetActionController(\Zend_Controller_Action $actionController = null
) : \Zend_Controller_ActionHelper_Abstract
\Zend_Controller_Action
\Zend_Controller_ActionHelper_Abstract
Provides a fluent interfacesetAutoDisableLayout(boolean $flag) : \Zend_Controller_Action_Helper_ContextSwitch
boolean
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetAutoJsonSerialization(boolean $flag) : \Zend_Controller_Action_Helper_ContextSwitch
boolean
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetCallback(string $context, string $trigger, string|array $callback) : \Zend_Controller_Action_Helper_ContextSwitch
string
string
string
array
\Zend_Controller_Action_Exception |
---|
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetCallbacks(string $context, array $callbacks) : \Zend_Controller_Action_Helper_ContextSwitch
Callbacks should be in trigger/callback pairs.
string
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetConfig(\Zend_Config $config) : \Zend_Controller_Action_Helper_ContextSwitch
\Zend_Config
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetContext(string $context, array $spec) : \Zend_Controller_Action_Helper_ContextSwitch
string
Context type
array
Context specification
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetContextParam(string $name) : \Zend_Controller_Action_Helper_ContextSwitch
string
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetContexts(array $contexts) : \Zend_Controller_Action_Helper_ContextSwitch
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetDefaultContext(string $type) : \Zend_Controller_Action_Helper_ContextSwitch
string
\Zend_Controller_Action_Exception |
---|
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetHeader($context, string $header, string $content) : \Zend_Controller_Action_Helper_ContextSwitch
Passing an empty header value to the setters disables the response header.
string
Header to set
string
Header content
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetHeaders(string $context, array $headers) : \Zend_Controller_Action_Helper_ContextSwitch
string
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetOptions(array $options) : \Zend_Controller_Action_Helper_ContextSwitch
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interfacesetSuffix(string $context, string $suffix, boolean $prependViewRendererSuffix = true
) : \Zend_Controller_Action_Helper_ContextSwitch
Passing an empty suffix value to the setters disables the view script suffix change.
string
Context type for which to set suffix
string
Suffix to use
boolean
Whether or not to prepend the new suffix to the viewrenderer suffix
\Zend_Controller_Action_Exception |
---|
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interface_getViewRenderer() : \Zend_Controller_Action_Helper_ViewRenderer
\Zend_Controller_Action_Helper_ViewRenderer
Provides a fluent interface_setCallbacks(array $options) : \Zend_Controller_Action_Helper_ContextSwitch
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interface_setHeaders(array $options) : \Zend_Controller_Action_Helper_ContextSwitch
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interface_setSuffix(array $spec) : \Zend_Controller_Action_Helper_ContextSwitch
array
\Zend_Controller_Action_Helper_ContextSwitch
Provides a fluent interface_validateTrigger(string $trigger) : string
string
\Zend_Controller_Action_Exception |
---|
string
$_actionController : \Zend_Controller_Action
null
$_autoJsonSerialization : boolean
true
$_contextKey : string
'ajaxable'
inherited_from | \Zend_Controller_Action_Helper_ContextSwitch::_contextKey |
---|
$_contextKey : string
'contexts'
$_contextParam : string
'format'
$_contexts : array
array()
$_currentContext : string
$_defaultContext : string
'xml'
$_disableLayout : boolean
true
$_frontController : mixed
null
$_specialConfig : array
array('setSuffix', 'setHeaders', 'setCallbacks')
$_unconfigurable : array
array('setOptions', 'setConfig', 'setHeader', 'setCallback', 'setContext', 'setActionContext', 'setActionContexts')
$_viewRenderer : \Zend_Controller_Action_Helper_ViewRenderer
$_viewSuffixOrig : string
TRIGGER_INIT = 'TRIGGER_INIT'
TRIGGER_POST = 'TRIGGER_POST'