Zend_Controller_Action| Class | Description |
|---|---|
Zend_Rest_Controller
|
An abstract class to guide implementation of action controllers for use with Zend_Rest_Route. |
void
__construct
(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, [ $invokeArgs = array()])
void
render
([string|null $action = null], [string|null $name = null], [bool $noController = false])
Zend_Controller_Response_Abstract
run
([Zend_Controller_Request_Abstract $request = null], [Zend_Controller_Response_Abstract $response = null])
void
_forward
(string $action, [string $controller = null], [string $module = null], [ $params = null])
Zend_View_Interface
$view
(line 92)
View object
string
$viewSuffix
= 'phtml' (line 86)
View script suffix; defaults to 'phtml'
array
$_classMethods
(line 48)
array
$_delimiters
(line 54)
Word delimiters (used for normalizing view script paths)
Zend_Controller_Front
$_frontController
(line 67)
Front controller instance
Zend_Controller_Action_HelperBroker
$_helper
= null (line 99)
Helper Broker to assist in routing help requests to the proper object
array
$_invokeArgs
= array() (line 61)
Array of arguments provided to the constructor, minus the $_request.
Zend_Controller_Request_Abstract
$_request
= null (line 73)
Zend_Controller_Request_Abstract object wrapping the request environment
Zend_Controller_Response_Abstract
$_response
= null (line 79)
Zend_Controller_Response_Abstract object wrapping the response
Constructor __construct (line 127)
Class constructor
The request and response objects should be registered with the controller, as should be any additional optional arguments; these will be available via getRequest(), getResponse(), and getInvokeArgs(), respectively.
When overriding the constructor, please consider this usage as a best practice and ensure that each is registered appropriately; the easiest way to do so is to simply call parent::__construct($request, $response, $invokeArgs).
After the request, response, and invokeArgs are set, the helper broker is initialized.
Finally, init() is called as the final action of instantiation, and may be safely overridden to perform initialization tasks; as a general rule, override init() instead of the constructor to customize an action controller's instantiation.
dispatch (line 497)
Dispatch the requested action
getHelper (line 387)
Get a helper by name
getHelperCopy (line 398)
Get a clone of a helper by name
getInvokeArg (line 372)
Return a single invocation argument
getInvokeArgs (line 361)
Return the array of constructor arguments (minus the Request object)
getViewScript (line 263)
Construct view script path
Used by render() to determine the path to the view script.
init (line 143)
Initialize object
Called from __construct() as final step of object instantiation.
initView (line 163)
Initialize View object
Initializes $view if not otherwise a Zend_View_Interface.
If $view is not otherwise set, instantiates a new Zend_View object, using the 'views' subdirectory at the same level as the controller directory for the current module as the base directory. It uses this to set the following:
postDispatch (line 465)
Post-dispatch routines
Called after action method execution. If using class with Zend_Controller_Front, it may modify the Request object and reset its dispatched flag in order to process an additional action.
Common usages for postDispatch() include rendering content in a sitewide template, link url correction, setting headers, etc.
preDispatch (line 448)
Pre-dispatch routines
Called before action method. If using class with Zend_Controller_Front, it may modify the Request object and reset its dispatched flag in order to skip processing the current action.
render (line 209)
Render a view
Renders a view. By default, views are found in the view script path as <controller>/<action>.phtml. You may change the script suffix by resetting $viewSuffix. You may omit the controller directory prefix by specifying boolean true for $noController.
By default, the rendered contents are appended to the response. You may specify the named body content segment to set by specifying a $name.
renderScript (line 240)
Render a given view script
Similar to render(), this method renders a view script. Unlike render(), however, it does not autodetermine the view script via getViewScript(), but instead renders the script passed to it. Use this if you know the exact view script name and path you wish to use, or if using paths that do not conform to the spec defined with getViewScript().
By default, the rendered contents are appended to the response. You may specify the named body content segment to set by specifying a $name.
run (line 545)
Call the action specified in the request object, and return a response
Not used in the Action Controller implementation, but left for usage in Page Controller implementations. Dispatches a method based on the request.
Returns a Zend_Controller_Response_Abstract object, instantiating one prior to execution if none exists in the controller.
preDispatch() is called prior to the action, postDispatch() is called following it.
_forward (line 654)
Forward to another controller/action.
It is important to supply the unformatted names, i.e. "article" rather than "ArticleController". The dispatcher will do the appropriate formatting when the request is received.
If only an action name is provided, forwards to that action in this controller.
If an action and controller are specified, forwards to that action and controller in this module.
Specifying an action, controller, and module is the most specific way to forward.
A fourth argument, $params, will be used to set the request parameters. If either the controller or module are unnecessary for forwarding, simply pass null values for them before specifying the parameters.
_getAllParams (line 622)
Return all parameters in the $_request as an associative array.
_getParam (line 580)
Gets a parameter from the $_request. If the parameter does not exist, NULL will be returned.
If the parameter does not exist and $default is set, then $default will be returned instead of NULL.
_hasParam (line 611)
Determine whether a given parameter exists in the $_request.
_redirect (line 684)
Redirect to another URL
Proxies to Zend_Controller_Action_Helper_Redirector::gotoUrl().
_setInvokeArgs (line 350)
Set invocation arguments
_setParam (line 597)
Set a parameter in the $_request.
__call (line 480)
Proxy 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.
Documentation generated on Mon, 21 Jun 2010 15:06:12 -0400 by phpDocumentor 1.4.3