Class Zend_Controller_Dispatcher

Description

Implements interfaces:

  • license: New BSD License
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Controller/Dispatcher.php (line 44)


	
			
Variable Summary
Method Summary
 void __construct ([ $params = array()])
 Zend_Controller_Dispatcher clearParams ([null|string|array $name = null])
 string formatActionName (string $unformatted)
 string formatControllerName (string $unformatted)
 string formatModuleName (string $unformatted)
 string getDefaultAction ()
 mixed getParam (string $name)
 array getParams ()
 array getPathDelimiter ()
 array getWordDelimiter ()
 Zend_Controller_Dispatcher setParam (string $name, mixed $value)
 string _formatName (string $unformatted, [boolean $isAction = false])
 array _verifyDelimiter (string|array $spec)
Variables
string $_curDirectory (line 50)

Current dispatchable directory

  • access: protected
string $_defaultAction = 'index' (line 56)

Default action name; defaults to 'index'

  • access: protected
string $_defaultController = 'index' (line 62)

Default controller name; defaults to 'index'

  • access: protected
array $_directories = array() (line 68)

Directories where Zend_Controller_Action files are stored.

  • access: protected
array $_invokeParams = array() (line 75)

Array of invocation parameters to use when instantiating action

controllers

  • access: protected
string $_pathDelimiter = '_' (line 81)

Path delimiter character

  • access: protected
Zend_Controller_Response_Abstract|null $_response = null (line 87)

Response object to pass to action controllers, if any

  • access: protected
array $_wordDelimiter = array('-', '.') (line 93)

Word delimiter characters

  • access: protected
Methods
Constructor __construct (line 100)

Constructor

  • access: public
void __construct ([ $params = array()])
  • array $params
addControllerDirectory (line 276)

Add a single path to the controller directory stack

  • access: public
Zend_Controller_Dispatcher addControllerDirectory (string $path)
  • string $path

Implementation of:
Zend_Controller_Dispatcher_Interface::addControllerDirectory()
Add a controller directory to the controller directory stack
clearParams (line 397)

Clear 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.

  • access: public
Zend_Controller_Dispatcher clearParams ([null|string|array $name = null])
  • null|string|array $name: single key or array of keys for params to clear

Implementation of:
Zend_Controller_Dispatcher_Interface::clearParams()
Clear the controller parameter stack
dispatch (line 485)

Dispatch to a controller/action

  • access: public
boolean dispatch (Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response)

Implementation of:
Zend_Controller_Dispatcher_Interface::dispatch()
Dispatches a request object to a controller/action. If the action requests a forward to another action, a new request will be returned.
formatActionName (line 140)

Formats a string into an action name. This is used to take a raw action name, such as one that would be packaged inside a Zend_Controller_Dispatcher_Token object, and reformat into a proper method name that would be found inside a class extending Zend_Controller_Action.

  • access: public
  • todo: Should action method names allow underscores?
string formatActionName (string $unformatted)
  • string $unformatted

Implementation of:
Zend_Controller_Dispatcher_Interface::formatActionName()
Formats a string into an action name. This is used to take a raw action name, such as one that would be packaged inside a request object, and reformat into a proper method name that would be found inside a class extending Zend_Controller_Action.
formatControllerName (line 125)

Formats a string into a controller name. This is used to take a raw controller name, such as one that would be packaged inside a Zend_Controller_Dispatcher_Token object, and reformat it to a proper class name that a class extending Zend_Controller_Action would use.

  • access: public
string formatControllerName (string $unformatted)
  • string $unformatted

Implementation of:
Zend_Controller_Dispatcher_Interface::formatControllerName()
Formats a string into a controller name. This is used to take a raw controller name, such as one that would be packaged inside a request object, and reformat it to a proper class name that a class extending Zend_Controller_Action would use.
formatModuleName (line 111)

Format the module name.

  • access: public
string formatModuleName (string $unformatted)
  • string $unformatted

Implementation of:
Zend_Controller_Dispatcher_Interface::formatModuleName()
Formats a string into a module name. This is used to take a raw module name, such as one that would be packaged inside a request object, and reformat it to a proper class name prefix that a class extending Zend_Controller_Action would use.
getControllerDirectory (line 313)

Return the currently set directory for Zend_Controller_Action class lookup

  • access: public
string getControllerDirectory ()

Implementation of:
Zend_Controller_Dispatcher_Interface::getControllerDirectory()
Return the currently set directory(ies) for controller file lookup
getDefaultAction (line 473)

Retrive the default action name (minus formatting)

  • access: public
string getDefaultAction ()

Implementation of:
Zend_Controller_Dispatcher_Interface::getDefaultAction()
Retrieve the default action name (minus formatting)
getDefaultController (line 452)

Retrive the default controller name (minus formatting)

  • access: public
string getDefaultController ()

Implementation of:
Zend_Controller_Dispatcher_Interface::getDefaultController()
Retrieve the default controller name (minus formatting)
getParam (line 368)

Retrieve a single parameter from the controller parameter stack

  • access: public
mixed getParam (string $name)
  • string $name

Implementation of:
Zend_Controller_Dispatcher_Interface::getParam()
Retrieve a single parameter from the controller parameter stack
getParams (line 382)

Retrieve action controller instantiation parameters

  • access: public
array getParams ()

Implementation of:
Zend_Controller_Dispatcher_Interface::getParams()
Retrieve the parameters to pass to the Action Controller constructor
getPathDelimiter (line 215)

Retrieve the path delimiter character(s) used in controller/module/action names

  • access: public
array getPathDelimiter ()
getResponse (line 431)

Return the registered response object

  • access: public
Zend_Controller_Response_Abstract|null getResponse ()

Implementation of:
Zend_Controller_Dispatcher_Interface::getResponse()
Retrieve the response object, if any
getWordDelimiter (line 187)

Retrieve the word delimiter character(s) used in controller/module/action names

  • access: public
array getWordDelimiter ()
isDispatchable (line 329)

Returns TRUE if the Zend_Controller_Request_Abstract object can be dispatched to a controller.

This only verifies that the Zend_Controller_Action can be dispatched and does not guarantee that the action will be accepted by the Zend_Controller_Action.

  • access: public
boolean isDispatchable (Zend_Controller_Request_Abstract $request, Zend_Controller_Request_Abstract $action)

Implementation of:
Zend_Controller_Dispatcher_Interface::isDispatchable()
Returns TRUE if an action can be dispatched, or FALSE otherwise.
setControllerDirectory (line 293)

Sets the directory(ies) where the Zend_Controller_Action class files are stored.

  • access: public
Zend_Controller_Dispatcher setControllerDirectory (string|array $path)
  • string|array $path

Implementation of:
Zend_Controller_Dispatcher_Interface::setControllerDirectory()
Set the directory where controller files are stored
setDefaultAction (line 463)

Set the default action (minus any formatting)

  • access: public
Zend_Controller_Dispatcher setDefaultAction (string $action)
  • string $action

Implementation of:
Zend_Controller_Dispatcher_Interface::setDefaultAction()
Set default action name (minus formatting)
setDefaultController (line 442)

Set the default controller (minus any formatting)

  • access: public
Zend_Controller_Dispatcher setDefaultController (string $controller)
  • string $controller

Implementation of:
Zend_Controller_Dispatcher_Interface::setDefaultController()
Set default controller name (minus formatting)
setParam (line 343)

Add or modify a parameter to use when instantiating an action controller

  • access: public
Zend_Controller_Dispatcher setParam (string $name, mixed $value)
  • string $name
  • mixed $value

Implementation of:
Zend_Controller_Dispatcher_Interface::setParam()
Add or modify a parameter with which to instantiate an Action Controller
setParams (line 356)

Set parameters to pass to action controller constructors

  • access: public
Zend_Controller_Dispatcher setParams ( $params)
  • array $params

Implementation of:
Zend_Controller_Dispatcher_Interface::setParams()
Set an array of a parameters to pass to the Action Controller constructor
setPathDelimiter (line 229)

Set path delimiter

Set the path delimiter to use in controllers/modules/actions. May be a single string or an array of strings.

  • access: public
Zend_Controller_Dispatcher setPathDelimiter (string|array $spec)
  • string|array $spec
setResponse (line 420)

Set response object to pass to action controllers

  • access: public

Implementation of:
Zend_Controller_Dispatcher_Interface::setResponse()
Set the response object to use, if any
setWordDelimiter (line 201)

Set word delimiter

Set the word delimiter to use in controllers/modules/actions. May be a single string or an array of strings.

  • access: public
Zend_Controller_Dispatcher setWordDelimiter (string|array $spec)
  • string|array $spec
_formatName (line 252)

Formats a string from a URI into a PHP-friendly name.

By default, replaces words separated by '-' or '.' with camelCaps. If $isAction is false, it also preserves underscores, and makes the letter following the underscore uppercase. All non-alphanumeric characters are removed.

  • access: protected
string _formatName (string $unformatted, [boolean $isAction = false])
  • string $unformatted
  • boolean $isAction: Defaults to false
_getAction (line 594)

Determine the action name

First attempt to retrieve from request; then from request params using action key; default to default action

Returns formatted action name

  • access: protected
string _getAction (Zend_Controller_Request_Abstract $request)
_getController (line 560)

Get controller name

Try request first; if not found, try pulling from request parameter; if still not found, fallback to default

  • return: Returns class name on success
  • access: protected
string|false _getController (Zend_Controller_Request_Abstract $request)
_verifyDelimiter (line 156)

Verify delimiter

Verify a delimiter to use in controllers/modules/actions. May be a single string or an array of strings.

  • access: public
  • throws: Zend_Controller_Dispatcher_Exception with invalid delimiters
array _verifyDelimiter (string|array $spec)
  • string|array $spec

Documentation generated on Thu, 18 Jan 2007 09:52:59 -0800 by phpDocumentor 1.3.1