Controller/Action.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Controller
- Version
- $Id$
\Zend_Controller_Action
- Implements
- Children
- \Zend_Rest_Controller
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

\Zend_Controller_Action_HelperBroker $_helper = nullnullDetails
array $_invokeArgs = array()array()Details- Type
- array

\Zend_Controller_Request_Abstract $_request = nullnullDetails
\Zend_Controller_Response_Abstract $_response = nullnullDetailsMethods

__call(string $methodName, array $args) : voidProxy for undefined methods. Default behavior is to throw an exception on undefined methods, however this function can be overridden to implement magic (dynamic) actions, or provide run-time dispatching.
| Name | Type | Description |
|---|---|---|
| $methodName | string | |
| $args | array |
| Exception | Description |
|---|---|
| \Zend_Controller_Action_Exception |

__construct(\Zend_Controller_Request_Abstract $request, \Zend_Controller_Response_Abstract $response, array $invokeArgs = array()) : voidClass constructor
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract | |
| $response | \Zend_Controller_Response_Abstract | |
| $invokeArgs | array | Any additional invocation arguments |

_forward(string $action, string $controller = null, string $module = null, array $params = null) : voidForward to another controller/action.
| Name | Type | Description |
|---|---|---|
| $action | string | |
| $controller | string | |
| $module | string | |
| $params | array |
- Deprecated
- Deprecated as of Zend Framework 1.7. Use forward() instead.

_getAllParams() : arrayReturn all parameters in the {@link $_request Request object} as an associative array.
| Type | Description |
|---|---|
| array |
- Deprecated
- Deprecated as of Zend Framework 1.7. Use getAllParams() instead.

_getParam(string $paramName, mixed $default = null) : mixedGets a parameter from the {@link $_request Request object}. If the parameter does not exist, NULL will be returned.
| Name | Type | Description |
|---|---|---|
| $paramName | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

_hasParam(string $paramName) : booleanDetermine whether a given parameter exists in the {@link $_request Request object}.
| Name | Type | Description |
|---|---|---|
| $paramName | string |
| Type | Description |
|---|---|
| boolean |
- Deprecated
- Deprecated as of Zend Framework 1.7. Use hasParam() instead.

_redirect(string $url, array $options = array()) : voidRedirect to another URL
| Name | Type | Description |
|---|---|---|
| $url | string | |
| $options | array | Options to be used when redirecting |
- Deprecated
- Deprecated as of Zend Framework 1.7. Use redirect() instead.

_setInvokeArgs(array $args = array()) : \Zend_Controller_ActionSet invocation arguments
| Name | Type | Description |
|---|---|---|
| $args | array |
| Type | Description |
|---|---|
| \Zend_Controller_Action |

_setParam(string $paramName, mixed $value) : \Zend_Controller_ActionSet a parameter in the {@link $_request Request object}.
| Name | Type | Description |
|---|---|---|
| $paramName | string | |
| $value | mixed |
| Type | Description |
|---|---|
| \Zend_Controller_Action |
- Deprecated
- Deprecated as of Zend Framework 1.7. Use setParam() instead.

dispatch(string $action) : voidDispatch the requested action
| Name | Type | Description |
|---|---|---|
| $action | string | Method name of action |

forward(string $action, string $controller = null, string $module = null, array $params = null) : voidForward to another controller/action.
| Name | Type | Description |
|---|---|---|
| $action | string | |
| $controller | string | |
| $module | string | |
| $params | array |

getAllParams() : arrayReturn all parameters in the {@link $_request Request object} as an associative array.
| Type | Description |
|---|---|
| array |

getFrontController() : \Zend_Controller_FrontRetrieve Front Controller
| Type | Description |
|---|---|
| \Zend_Controller_Front |

getHelper(string $helperName) : \Zend_Controller_Action_Helper_AbstractGet a helper by name
| Name | Type | Description |
|---|---|---|
| $helperName | string |
| Type | Description |
|---|---|
| \Zend_Controller_Action_Helper_Abstract |

getHelperCopy(string $helperName) : \Zend_Controller_Action_Helper_AbstractGet a clone of a helper by name
| Name | Type | Description |
|---|---|---|
| $helperName | string |
| Type | Description |
|---|---|
| \Zend_Controller_Action_Helper_Abstract |

getInvokeArg(string $key) : mixedReturn a single invocation argument
| Name | Type | Description |
|---|---|---|
| $key | string |
| Type | Description |
|---|---|
| mixed |

getInvokeArgs() : arrayReturn the array of constructor arguments (minus the Request object)
| Type | Description |
|---|---|
| array |

getParam(string $paramName, mixed $default = null) : mixedGets a parameter from the {@link $_request Request object}. If the parameter does not exist, NULL will be returned.
| Name | Type | Description |
|---|---|---|
| $paramName | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

getRequest() : \Zend_Controller_Request_AbstractReturn the Request object
| Type | Description |
|---|---|
| \Zend_Controller_Request_Abstract |

getResponse() : \Zend_Controller_Response_AbstractReturn the Response object
| Type | Description |
|---|---|
| \Zend_Controller_Response_Abstract |

getViewScript(string $action = null, bool $noController = null) : stringConstruct view script path
| Name | Type | Description |
|---|---|---|
| $action | string | Defaults to action registered in request object |
| $noController | bool | Defaults to false; i.e. use controller name as subdir in which to search for view script |
| Type | Description |
|---|---|
| string |
| Exception | Description |
|---|---|
| \Zend_Controller_Exception | with bad $action |

hasParam(string $paramName) : booleanDetermine whether a given parameter exists in the {@link $_request Request object}.
| Name | Type | Description |
|---|---|---|
| $paramName | string |
| Type | Description |
|---|---|
| boolean |

init() : voidInitialize object

initView() : \Zend_View_InterfaceInitialize View object
| Type | Description |
|---|---|
| \Zend_View_Interface |
| Exception | Description |
|---|---|
| \Zend_Controller_Exception | if base view directory does not exist |

postDispatch() : voidPost-dispatch routines

preDispatch() : voidPre-dispatch routines

redirect(string $url, array $options = array()) : voidRedirect to another URL
| Name | Type | Description |
|---|---|---|
| $url | string | |
| $options | array | Options to be used when redirecting |

render(string | null $action = null, string | null $name = null, bool $noController = false) : voidRender a view
| Name | Type | Description |
|---|---|---|
| $action | string | null | Defaults to action registered in request object |
| $name | string | null | Response object named path segment to use; defaults to null |
| $noController | bool | Defaults to false; i.e. use controller name as subdir in which to search for view script |

renderScript(string $script, string $name = null) : voidRender a given view script
| Name | Type | Description |
|---|---|---|
| $script | string | |
| $name | string |

run(null | \Zend_Controller_Request_Abstract $request = null, null | \Zend_Controller_Response_Abstract $response = null) : \Zend_Controller_Response_AbstractCall the action specified in the request object, and return a response
| Name | Type | Description |
|---|---|---|
| $request | null | \Zend_Controller_Request_Abstract | Optional request object to use |
| $response | null | \Zend_Controller_Response_Abstract | Optional response object to use |
| Type | Description |
|---|---|
| \Zend_Controller_Response_Abstract |

setFrontController(\Zend_Controller_Front $front) : \Zend_Controller_ActionSet the front controller instance
| Name | Type | Description |
|---|---|---|
| $front | \Zend_Controller_Front |
| Type | Description |
|---|---|
| \Zend_Controller_Action |

setParam(string $paramName, mixed $value) : \Zend_Controller_ActionSet a parameter in the {@link $_request Request object}.
| Name | Type | Description |
|---|---|---|
| $paramName | string | |
| $value | mixed |
| Type | Description |
|---|---|
| \Zend_Controller_Action |

setRequest(\Zend_Controller_Request_Abstract $request) : \Zend_Controller_ActionSet the Request object
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |
| Type | Description |
|---|---|
| \Zend_Controller_Action |

setResponse(\Zend_Controller_Response_Abstract $response) : \Zend_Controller_ActionSet the Response object
| Name | Type | Description |
|---|---|---|
| $response | \Zend_Controller_Response_Abstract |
| Type | Description |
|---|---|
| \Zend_Controller_Action |