category | Zend |
---|---|
package | Zend_Controller |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
addControllerDirectory(string $directory, string $module = null
) : \Zend_Controller_Front
If $args is presented and is a string, uses it for the array key mapping to the directory specified.
string
string
Optional argument; module with which to associate directory. If none provided, assumes 'default'
\Zend_Controller_Exception |
if directory not found or readable |
---|
\Zend_Controller_Front
addModuleDirectory(string $path) : \Zend_Controller_Front
Iterates through the directory, adding any subdirectories as modules; the subdirectory within each module named after \$_moduleControllerDirectoryName will be used as the controller directory path.
string
\Zend_Controller_Front
clearParams($name = null
) : \Zend_Controller_Front
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.
\Zend_Controller_Front
dispatch(\Zend_Controller_Request_Abstract|null $request= null
, \Zend_Controller_Response_Abstract|null $response= null
) : void | \Zend_Controller_Response_Abstract
\Zend_Controller_Request_Abstract
null
\Zend_Controller_Response_Abstract
null
void
\Zend_Controller_Response_Abstract
Returns response object if returnResponse() is truegetBaseUrl() : string
string
getControllerDirectory(string $name = null
) : array | string | null
Retrieves:
string
Default null
array
string
null
getDefaultAction() : string
string
getDefaultControllerName() : string
string
getDefaultModule() : string
string
getDispatcher() : \Zend_Controller_Dispatcher_Interface
\Zend_Controller_Dispatcher_Interface
getInstance() : \Zend_Controller_Front
\Zend_Controller_Front
getModuleControllerDirectoryName() : string
string
getModuleDirectory(string $module = null
) : string | null
string
string
null
getParam(string $name) : mixed
string
mixed
getParams() : array
array
getPlugin(string $class) : false | \Zend_Controller_Plugin_Abstract | array
string
false
\Zend_Controller_Plugin_Abstract
array
getPlugins() : array
array
getRequest() : null | \Zend_Controller_Request_Abstract
null
\Zend_Controller_Request_Abstract
getResponse() : null | \Zend_Controller_Response_Abstract
null
\Zend_Controller_Response_Abstract
getRouter() : \Zend_Controller_Router_Interface
Instantiates a Zend_Controller_Router_Rewrite object if no router currently set.
\Zend_Controller_Router_Interface
hasPlugin(string $class) : boolean
string
boolean
registerPlugin(\Zend_Controller_Plugin_Abstract $plugin, integer $stackIndex = null
) : \Zend_Controller_Front
\Zend_Controller_Plugin_Abstract
integer
Optional; stack index for plugin
\Zend_Controller_Front
removeControllerDirectory(string $module) : boolean
string
boolean
resetInstance() : void
Primarily used for testing; could be used to chain front controllers.
Also resets action helper broker, clearing all registered helpers.
returnResponse(boolean $flag = null
) : boolean | \Zend_Controller_Front
boolean
boolean
\Zend_Controller_Front
Used as a setter, returns object; as a getter, returns booleanrun(string|array $controllerDirectory) : void
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.
string
array
Path to Zend_Controller_Action controller classes or array of such paths
\Zend_Controller_Exception |
if called from an object instance |
---|
setBaseUrl(string $base = null
) : \Zend_Controller_Front
Use to set the base URL segment of the REQUEST_URI to use when determining PATH_INFO, etc. Examples:
Note that the URL should not include the full URI. Do not use:
If a null value is passed, this can be used as well for autodiscovery (default).
string
\Zend_Controller_Exception |
for non-string $base |
---|
\Zend_Controller_Front
setControllerDirectory(string|array $directory, string $module = null
) : \Zend_Controller_Front
Stores controller directory(ies) in dispatcher. May be an array of directories or a string containing a single directory.
string
array
Path to Zend_Controller_Action controller classes or array of such paths
string
Optional module name to use with string $directory
\Zend_Controller_Front
setDefaultAction(string $action) : \Zend_Controller_Front
string
\Zend_Controller_Front
setDefaultControllerName(string $controller) : \Zend_Controller_Front
string
\Zend_Controller_Front
setDefaultModule(string $module) : \Zend_Controller_Front
string
\Zend_Controller_Front
setDispatcher(\Zend_Controller_Dispatcher_Interface $dispatcher) : \Zend_Controller_Front
\Zend_Controller_Dispatcher_Interface
\Zend_Controller_Front
setModuleControllerDirectoryName(string $name = 'controllers'
) : \Zend_Controller_Front
string
\Zend_Controller_Front
setParam(string $name, mixed $value) : \Zend_Controller_Front
string
mixed
\Zend_Controller_Front
setParams(array $params) : \Zend_Controller_Front
array
\Zend_Controller_Front
setRequest(string|\Zend_Controller_Request_Abstract $request) : \Zend_Controller_Front
Set the request object. The request holds the request environment.
If a class name is provided, it will instantiate it
string
\Zend_Controller_Request_Abstract
\Zend_Controller_Exception |
if invalid request class |
---|
\Zend_Controller_Front
setResponse(string|\Zend_Controller_Response_Abstract $response) : \Zend_Controller_Front
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.
string
\Zend_Controller_Response_Abstract
\Zend_Controller_Exception |
if invalid response class |
---|
\Zend_Controller_Front
setRouter(string|\Zend_Controller_Router_Interface $router) : \Zend_Controller_Front
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 \setParam() or \setParams().
string
\Zend_Controller_Router_Interface
\Zend_Controller_Exception |
if invalid router class |
---|
\Zend_Controller_Front
throwExceptions(boolean $flag = null
) : boolean | \Zend_Controller_Front
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.
boolean
Defaults to null (return flag state)
boolean
\Zend_Controller_Front
Used as a setter, returns object; as a getter, returns booleanunregisterPlugin(string|\Zend_Controller_Plugin_Abstract $plugin) : \Zend_Controller_Front
string
\Zend_Controller_Plugin_Abstract
Plugin class or object to unregister
\Zend_Controller_Front
__construct() : void
Instantiate using \getInstance(); front controller is a singleton object.
Instantiates the plugin broker.
__clone() : void
$_baseUrl : string
null
$_controllerDir : string | array
null
$_dispatcher : \Zend_Controller_Dispatcher_Interface
null
$_instance : \Zend_Controller_Front
null
Marked only as protected to allow extension of the class. To extend, simply override \getInstance().
$_invokeParams : array
array()
$_moduleControllerDirectoryName : string
'controllers'
$_plugins : \Zend_Controller_Plugin_Broker
null
$_request : \Zend_Controller_Request_Abstract
null
$_response : \Zend_Controller_Response_Abstract
null
$_returnResponse : boolean
false
$_router : \Zend_Controller_Router_Interface
null
$_throwExceptions : boolean
false