Controller/Front.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_Front
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

string|array $_controllerDir = nullnullDetails- Type
- string | array

\Zend_Controller_Dispatcher_Interface $_dispatcher = nullnullDetails
\Zend_Controller_Front $_instance = nullnullDetails
array $_invokeParams = array()array()Details- Type
- array

string $_moduleControllerDirectoryName = 'controllers''controllers'Details- Type
- string

\Zend_Controller_Plugin_Broker $_plugins = nullnullDetails
\Zend_Controller_Request_Abstract $_request = nullnullDetails
\Zend_Controller_Response_Abstract $_response = nullnullDetails
boolean $_returnResponse = falsefalseDetails- Type
- boolean

\Zend_Controller_Router_Interface $_router = nullnullDetailsMethods

__construct() : voidConstructor

addControllerDirectory(string $directory, string $module = null) : \Zend_Controller_FrontAdd a controller directory to the controller directory stack
| Name | Type | Description |
|---|---|---|
| $directory | string | |
| $module | string | Optional argument; module with which to associate directory. If none provided, assumes 'default' |
| Type | Description |
|---|---|
| \Zend_Controller_Front |
| Exception | Description |
|---|---|
| \Zend_Controller_Exception | if directory not found or readable |

addModuleDirectory(string $path) : \Zend_Controller_FrontSpecify a directory as containing modules
| Name | Type | Description |
|---|---|---|
| $path | string |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

clearParams( $name = null) : \Zend_Controller_FrontClear the controller parameter stack
| Name | Type | Description |
|---|---|---|
| $name |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

dispatch(\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.
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract | null | |
| $response | \Zend_Controller_Response_Abstract | null |
| Type | Description |
|---|---|
| void | \Zend_Controller_Response_Abstract | Returns response object if returnResponse() is true |

getControllerDirectory(string $name = null) : array | string | nullRetrieve controller directory
| Name | Type | Description |
|---|---|---|
| $name | string | Default null |
| Type | Description |
|---|---|
| array | string | null |

getDefaultAction() : stringRetrieve the default action (unformatted string)
| Type | Description |
|---|---|
| string |

getDefaultControllerName() : stringRetrieve the default controller (unformatted string)
| Type | Description |
|---|---|
| string |

getDispatcher() : \Zend_Controller_Dispatcher_InterfaceReturn the dispatcher object.
| Type | Description |
|---|---|
| \Zend_Controller_Dispatcher_Interface |

getInstance() : \Zend_Controller_FrontSingleton instance
| Type | Description |
|---|---|
| \Zend_Controller_Front |

getModuleControllerDirectoryName() : stringReturn the directory name within a module containing controllers
| Type | Description |
|---|---|
| string |

getModuleDirectory(string $module = null) : string | nullReturn the path to a module directory (but not the controllers directory within)
| Name | Type | Description |
|---|---|---|
| $module | string |
| Type | Description |
|---|---|
| string | null |

getParam(string $name) : mixedRetrieve a single parameter from the controller parameter stack
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| mixed |

getPlugin(string $class) : false | \Zend_Controller_Plugin_Abstract | arrayRetrieve a plugin or plugins by class
| Name | Type | Description |
|---|---|---|
| $class | string |
| Type | Description |
|---|---|
| false | \Zend_Controller_Plugin_Abstract | array |

getRequest() : null | \Zend_Controller_Request_AbstractReturn the request object.
| Type | Description |
|---|---|
| null | \Zend_Controller_Request_Abstract |

getResponse() : null | \Zend_Controller_Response_AbstractReturn the response object.
| Type | Description |
|---|---|
| null | \Zend_Controller_Response_Abstract |

getRouter() : \Zend_Controller_Router_InterfaceReturn the router object.
| Type | Description |
|---|---|
| \Zend_Controller_Router_Interface |

hasPlugin(string $class) : boolIs a particular plugin registered?
| Name | Type | Description |
|---|---|---|
| $class | string |
| Type | Description |
|---|---|
| bool |

registerPlugin(\Zend_Controller_Plugin_Abstract $plugin, int $stackIndex = null) : \Zend_Controller_FrontRegister a plugin.
| Name | Type | Description |
|---|---|---|
| $plugin | \Zend_Controller_Plugin_Abstract | |
| $stackIndex | int | Optional; stack index for plugin |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

removeControllerDirectory(string $module) : boolRemove a controller directory by module name
| Name | Type | Description |
|---|---|---|
| $module | string |
| Type | Description |
|---|---|
| bool |

resetInstance() : voidResets all object properties of the singleton instance

returnResponse(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.
| Name | Type | Description |
|---|---|---|
| $flag | boolean |
| Type | Description |
|---|---|
| boolean | \Zend_Controller_Front | Used as a setter, returns object; as a getter, returns boolean |

run(string | array $controllerDirectory) : voidConvenience feature, calls setControllerDirectory()->setRouter()->dispatch()
| Name | Type | Description |
|---|---|---|
| $controllerDirectory | string | array | Path to Zend_Controller_Action controller classes or array of such paths |
| Exception | Description |
|---|---|
| \Zend_Controller_Exception | if called from an object instance |

setBaseUrl(string $base = null) : \Zend_Controller_FrontSet the base URL used for requests
| Name | Type | Description |
|---|---|---|
| $base | string |
| Type | Description |
|---|---|
| \Zend_Controller_Front |
| Exception | Description |
|---|---|
| \Zend_Controller_Exception | for non-string $base |

setControllerDirectory(string | array $directory, string $module = null) : \Zend_Controller_FrontSet controller directory
| Name | Type | Description |
|---|---|---|
| $directory | string | array | Path to Zend_Controller_Action controller classes or array of such paths |
| $module | string | Optional module name to use with string $directory |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

setDefaultAction(string $action) : \Zend_Controller_FrontSet the default action (unformatted string)
| Name | Type | Description |
|---|---|---|
| $action | string |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

setDefaultControllerName(string $controller) : \Zend_Controller_FrontSet the default controller (unformatted string)
| Name | Type | Description |
|---|---|---|
| $controller | string |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

setDefaultModule(string $module) : \Zend_Controller_FrontSet the default module name
| Name | Type | Description |
|---|---|---|
| $module | string |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

setDispatcher(\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.
| Name | Type | Description |
|---|---|---|
| $dispatcher | \Zend_Controller_Dispatcher_Interface |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

setModuleControllerDirectoryName(string $name = 'controllers') : \Zend_Controller_FrontSet the directory name within a module containing controllers
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

setParam(string $name, mixed $value) : \Zend_Controller_FrontAdd or modify a parameter to use when instantiating an action controller
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $value | mixed |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

setParams(array $params) : \Zend_Controller_FrontSet parameters to pass to action controller constructors
| Name | Type | Description |
|---|---|---|
| $params | array |
| Type | Description |
|---|---|
| \Zend_Controller_Front |

setRequest(string | \Zend_Controller_Request_Abstract $request) : \Zend_Controller_FrontSet request class/object
| Name | Type | Description |
|---|---|---|
| $request | string | \Zend_Controller_Request_Abstract |
| Type | Description |
|---|---|
| \Zend_Controller_Front |
| Exception | Description |
|---|---|
| \Zend_Controller_Exception | if invalid request class |

setResponse(string | \Zend_Controller_Response_Abstract $response) : \Zend_Controller_FrontSet response class/object
| Name | Type | Description |
|---|---|---|
| $response | string | \Zend_Controller_Response_Abstract |
| Type | Description |
|---|---|
| \Zend_Controller_Front |
| Exception | Description |
|---|---|
| \Zend_Controller_Exception | if invalid response class |

setRouter(string | \Zend_Controller_Router_Interface $router) : \Zend_Controller_FrontSet router class/object
| Name | Type | Description |
|---|---|---|
| $router | string | \Zend_Controller_Router_Interface |
| Type | Description |
|---|---|
| \Zend_Controller_Front |
| Exception | Description |
|---|---|
| \Zend_Controller_Exception | if invalid router class |

throwExceptions(boolean $flag = null) : boolean | \Zend_Controller_FrontSet the throwExceptions flag and retrieve current status
| Name | Type | Description |
|---|---|---|
| $flag | boolean | Defaults to null (return flag state) |
| Type | Description |
|---|---|
| boolean | \Zend_Controller_Front | Used as a setter, returns object; as a getter, returns boolean |

unregisterPlugin(string | \Zend_Controller_Plugin_Abstract $plugin) : \Zend_Controller_FrontUnregister a plugin.
| Name | Type | Description |
|---|---|---|
| $plugin | string | \Zend_Controller_Plugin_Abstract | Plugin class or object to unregister |
| Type | Description |
|---|---|
| \Zend_Controller_Front |