Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
array $_classMethods = ''
Detailsarray $_delimiters = ''Word delimiters (used for normalizing view script paths)
DetailsZend_Controller_Front $_frontController = ''Front controller instance
DetailsZend_Controller_Action_HelperBroker $_helper = 'null'Helper Broker to assist in routing help requests to the proper object
Detailsarray $_invokeArgs = 'array'Array of arguments provided to the constructor, minus the {@link $_request Request object}.
DetailsZend_Controller_Request_Abstract $_request = 'null'Zend_Controller_Request_Abstract object wrapping the request environment
DetailsZend_Controller_Response_Abstract $_response = 'null'Zend_Controller_Response_Abstract object wrapping the response
DetailsZend_View_Interface $view = ''View object
Detailsstring $viewSuffix = 'phtml'View script suffix; defaults to 'phtml'
Details__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.
Details__construct(
Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs
=
array
)
:
voidClass constructor
The request and response objects should be registered with the controller, as should be any additional optional arguments; these will be available via {@link getRequest()}, {@link getResponse()}, and {@link 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 {@link $_helper helper broker} is initialized.
Finally, {@link init()} is called as the final action of instantiation, and may be safely overridden to perform initialization tasks; as a general rule, override {@link init()} instead of the constructor to customize an action controller's instantiation.
Details_forward(
string $action, string $controller
=
null, string $module
=
null, array $params
=
null
)
:
voidForward 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.
Details_getAllParams(
)
:
arrayReturn all parameters in the {@link $_request Request object} as an associative array.
Details_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.
If the parameter does not exist and $default is set, then $default will be returned instead of NULL.
Details_hasParam(
string $paramName
)
:
booleanDetermine whether a given parameter exists in the {@link $_request Request object}.
Details_redirect(
string $url, array $options
=
array
)
:
voidRedirect to another URL
Proxies to {@link Zend_Controller_Action_Helper_Redirector::gotoUrl()}.
Details_setInvokeArgs(
array $args
=
array
)
:
Zend_Controller_ActionSet invocation arguments
Details_setParam(
string $paramName, mixed $value
)
:
Zend_Controller_ActionSet a parameter in the {@link $_request Request object}.
Detailsdispatch(
string $action
)
:
voidDispatch the requested action
DetailsgetFrontController(
)
:
Zend_Controller_FrontRetrieve Front Controller
DetailsgetHelper(
string $helperName
)
:
Zend_Controller_Action_Helper_AbstractGet a helper by name
DetailsgetHelperCopy(
string $helperName
)
:
Zend_Controller_Action_Helper_AbstractGet a clone of a helper by name
DetailsgetInvokeArg(
string $key
)
:
mixedReturn a single invocation argument
DetailsgetInvokeArgs(
)
:
arrayReturn the array of constructor arguments (minus the Request object)
DetailsgetRequest(
)
:
Zend_Controller_Request_AbstractReturn the Request object
DetailsgetResponse(
)
:
Zend_Controller_Response_AbstractReturn the Response object
DetailsgetViewScript(
string $action
=
null, bool $noController
=
null
)
:
stringConstruct view script path
Used by render() to determine the path to the view script.
Detailsinit(
)
:
voidInitialize object
Called from {@link __construct()} as final step of object instantiation.
DetailsinitView(
)
:
Zend_View_InterfaceInitialize View object
Initializes {@link $view} if not otherwise a Zend_View_Interface.
If {@link $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: - script path = views/scripts/ - helper path = views/helpers/ - filter path = views/filters/
DetailspostDispatch(
)
:
voidPost-dispatch routines
Called after action method execution. If using class with {@link Zend_Controller_Front}, it may modify the {@link $_request 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.
DetailspreDispatch(
)
:
voidPre-dispatch routines
Called before action method. If using class with {@link Zend_Controller_Front}, it may modify the {@link $_request Request object} and reset its dispatched flag in order to skip processing the current action.
Detailsrender(
string|null $action
=
null, string|null $name
=
null, bool $noController
=
false
)
:
voidRender a view
Renders a view. By default, views are found in the view script path as
By default, the rendered contents are appended to the response. You may specify the named body content segment to set by specifying a $name.
DetailsrenderScript(
string $script, string $name
=
null
)
:
voidRender a given view script
Similar to {@link render()}, this method renders a view script. Unlike render(), however, it does not autodetermine the view script via {@link 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.
Detailsrun(
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
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.
{@link preDispatch()} is called prior to the action, {@link postDispatch()} is called following it.
DetailssetFrontController(
Zend_Controller_Front $front
)
:
Zend_Controller_ActionSet the front controller instance
DetailssetRequest(
Zend_Controller_Request_Abstract $request
)
:
Zend_Controller_ActionSet the Request object
DetailssetResponse(
Zend_Controller_Response_Abstract $response
)
:
Zend_Controller_ActionSet the Response object
Details