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.
string $_baseUrl = 'null'Base URL
Detailsstring|array $_controllerDir = 'null'Directory|ies where controllers are stored
DetailsZend_Controller_Dispatcher_Interface $_dispatcher = 'null'Instance of Zend_Controller_Dispatcher_Interface
DetailsZend_Controller_Front $_instance = 'null'Singleton instance
Marked only as protected to allow extension of the class. To extend, simply override {@link getInstance()}.
Detailsarray $_invokeParams = 'array'Array of invocation parameters to use when instantiating action controllers
Detailsstring $_moduleControllerDirectoryName = 'controllers'Subdirectory within a module containing controllers; defaults to 'controllers'
DetailsZend_Controller_Plugin_Broker $_plugins = 'null'Instance of Zend_Controller_Plugin_Broker
DetailsZend_Controller_Request_Abstract $_request = 'null'Instance of Zend_Controller_Request_Abstract
DetailsZend_Controller_Response_Abstract $_response = 'null'Instance of Zend_Controller_Response_Abstract
Detailsboolean $_returnResponse = 'false'Whether or not to return the response prior to rendering output while in {@link dispatch()}; default is to send headers and render output.
DetailsZend_Controller_Router_Interface $_router = 'null'Instance of Zend_Controller_Router_Interface
Detailsboolean $_throwExceptions = 'false'Whether or not exceptions encountered in {@link dispatch()} should be thrown or trapped in the response object
Details__clone(
)
:
voidEnforce singleton; disallow cloning
Details__construct(
)
:
voidConstructor
Instantiate using {@link getInstance()}; front controller is a singleton object.
Instantiates the plugin broker.
DetailsaddControllerDirectory(
string $directory, string $module
=
null
)
:
Zend_Controller_FrontAdd a controller directory to the controller directory stack
If $args is presented and is a string, uses it for the array key mapping to the directory specified.
DetailsaddModuleDirectory(
string $path
)
:
Zend_Controller_FrontSpecify a directory as containing modules
Iterates through the directory, adding any subdirectories as modules; the subdirectory within each module named after {@link $_moduleControllerDirectoryName} will be used as the controller directory path.
DetailsclearParams(
null|string|array $name
=
null
)
:
Zend_Controller_FrontClear the controller parameter stack
By default, clears all parameters. If a parameter name is given, clears only that parameter; if an array of parameter names is provided, clears each.
Detailsdispatch(
Zend_Controller_Request_Abstract|null $request
=
null, Zend_Controller_Response_Abstract|null $response
=
null
)
:
void|Zend_Controller_Response_AbstractDispatch an HTTP request to a controller/action.
DetailsgetBaseUrl(
)
:
stringRetrieve the currently set base URL
DetailsgetControllerDirectory(
string $name
=
null
)
:
array|string|nullRetrieve controller directory
Retrieves: - Array of all controller directories if no $name passed - String path if $name passed and exists as a key in controller directory array - null if $name passed but does not exist in controller directory keys
DetailsgetDefaultAction(
)
:
stringRetrieve the default action (unformatted string)
DetailsgetDefaultControllerName(
)
:
stringRetrieve the default controller (unformatted string)
DetailsgetDefaultModule(
)
:
stringRetrieve the default module
DetailsgetDispatcher(
)
:
Zend_Controller_Dispatcher_InterfaceReturn the dispatcher object.
DetailsgetInstance(
)
:
Zend_Controller_FrontSingleton instance
DetailsgetModuleControllerDirectoryName(
)
:
stringReturn the directory name within a module containing controllers
DetailsgetModuleDirectory(
string $module
=
null
)
:
string|nullReturn the path to a module directory (but not the controllers directory within)
DetailsgetParam(
string $name
)
:
mixedRetrieve a single parameter from the controller parameter stack
DetailsgetParams(
)
:
arrayRetrieve action controller instantiation parameters
DetailsgetPlugin(
string $class
)
:
false|Zend_Controller_Plugin_Abstract|arrayRetrieve a plugin or plugins by class
DetailsgetPlugins(
)
:
arrayRetrieve all plugins
DetailsgetRequest(
)
:
null|Zend_Controller_Request_AbstractReturn the request object.
DetailsgetResponse(
)
:
null|Zend_Controller_Response_AbstractReturn the response object.
DetailsgetRouter(
)
:
Zend_Controller_Router_InterfaceReturn the router object.
Instantiates a Zend_Controller_Router_Rewrite object if no router currently set.
DetailshasPlugin(
string $class
)
:
boolIs a particular plugin registered?
DetailsregisterPlugin(
Zend_Controller_Plugin_Abstract $plugin, int $stackIndex
=
null
)
:
Zend_Controller_FrontRegister a plugin.
DetailsremoveControllerDirectory(
string $module
)
:
boolRemove a controller directory by module name
DetailsresetInstance(
)
:
voidResets all object properties of the singleton instance
Primarily used for testing; could be used to chain front controllers.
Also resets action helper broker, clearing all registered helpers.
DetailsreturnResponse(
boolean $flag
=
null
)
:
boolean|Zend_Controller_FrontSet whether {@link dispatch()} should return the response without first rendering output. By default, output is rendered and dispatch() returns nothing.
Detailsrun(
string|array $controllerDirectory
)
:
voidConvenience feature, calls setControllerDirectory()->setRouter()->dispatch()
In PHP 5.1.x, a call to a static method never populates $this -- so run() may actually be called after setting up your front controller.
DetailssetBaseUrl(
string $base
=
null
)
:
Zend_Controller_FrontSet the base URL used for requests
Use to set the base URL segment of the REQUEST_URI to use when determining PATH_INFO, etc. Examples: - /admin - /myapp - /subdir/index.php
Note that the URL should not include the full URI. Do not use: - http://example.com/admin - http://example.com/myapp - http://example.com/subdir/index.php
If a null value is passed, this can be used as well for autodiscovery (default).
DetailssetControllerDirectory(
string|array $directory, string $module
=
null
)
:
Zend_Controller_FrontSet controller directory
Stores controller directory(ies) in dispatcher. May be an array of directories or a string containing a single directory.
DetailssetDefaultAction(
string $action
)
:
Zend_Controller_FrontSet the default action (unformatted string)
DetailssetDefaultControllerName(
string $controller
)
:
Zend_Controller_FrontSet the default controller (unformatted string)
DetailssetDefaultModule(
string $module
)
:
Zend_Controller_FrontSet the default module name
DetailssetDispatcher(
Zend_Controller_Dispatcher_Interface $dispatcher
)
:
Zend_Controller_FrontSet the dispatcher object. The dispatcher is responsible for taking a Zend_Controller_Dispatcher_Token object, instantiating the controller, and call the action method of the controller.
DetailssetModuleControllerDirectoryName(
string $name
=
controllers
)
:
Zend_Controller_FrontSet the directory name within a module containing controllers
DetailssetParam(
string $name, mixed $value
)
:
Zend_Controller_FrontAdd or modify a parameter to use when instantiating an action controller
DetailssetParams(
array $params
)
:
Zend_Controller_FrontSet parameters to pass to action controller constructors
DetailssetRequest(
string|Zend_Controller_Request_Abstract $request
)
:
Zend_Controller_FrontSet request class/object
Set the request object. The request holds the request environment.
If a class name is provided, it will instantiate it
DetailssetResponse(
string|Zend_Controller_Response_Abstract $response
)
:
Zend_Controller_FrontSet response class/object
Set the response object. The response is a container for action responses and headers. Usage is optional.
If a class name is provided, instantiates a response object.
DetailssetRouter(
string|Zend_Controller_Router_Interface $router
)
:
Zend_Controller_FrontSet router class/object
Set the router object. The router is responsible for mapping the request to a controller and action.
If a class name is provided, instantiates router with any parameters registered via {@link setParam()} or {@link setParams()}.
DetailsthrowExceptions(
boolean $flag
=
null
)
:
boolean|Zend_Controller_FrontSet the throwExceptions flag and retrieve current status
Set whether exceptions encounted in the dispatch loop should be thrown or caught and trapped in the response object.
Default behaviour is to trap them in the response object; call this method to have them thrown.
Passing no value will return the current value of the flag; passing a boolean true or false value will set the flag and return the current object instance.
DetailsunregisterPlugin(
string|Zend_Controller_Plugin_Abstract $plugin
)
:
Zend_Controller_FrontUnregister a plugin.
Details