Docs For Class Zend_Controller_Dispatcher

## Class Zend_Controller_Dispatcher

Description

Implements interfaces:

- Zend_Controller_Dispatcher_Interface

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

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

Variable Summary
string $_defaultAction
string $_defaultController
string $_directory
array $_invokeParams
Zend_Controller_Response_Abstract|null $_response
Method Summary
void __construct ()
self addParam (mixed $param)
boolean dispatch (Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response)
string formatActionName (string $unformatted)
string formatControllerName (string $unformatted)
string getControllerDirectory ()
string getDefaultAction ()
string getDefaultController ()
array getParams ()
Zend_Controller_Response_Abstract|null getResponse ()
unknown isDispatchable (Zend_Controller_Request_Abstract $request, Zend_Controller_Request_Abstract $action)
self setControllerDirectory (string $dir)
self setDefaultAction (string $action)
self setDefaultController (string $controller)
self setParams ( $params)
self setResponse ([Zend_Controller_Response_Abstract $response = null])
void _dispatch (Zend_Controller_Request_Abstract $request, [boolean $performDispatch = true])
string _formatName (string $unformatted)
Variables
string $_defaultAction = 'index' (line 55)

Default action name; defaults to 'index'

- access: protected

string $_defaultController = 'index' (line 61)

Default controller name; defaults to 'index'

- access: protected

string $_directory = null (line 67)

Directory where Zend_Controller_Action files are stored.

- access: protected

array $_invokeParams = array() (line 74)

Array of invocation parameters to use when instantiating action

controllers

- access: protected

Zend_Controller_Response_Abstract|null $_response = null (line 80)

Response object to pass to action controllers, if any

- access: protected

Methods
Constructor __construct (line 87)

Constructor

- access: public

void __construct ()
addParam (line 195)

Add a parameter to use when instantiating an action controller

- access: public

self addParam (mixed $param)

- mixed $param

Implementation of:

Zend_Controller_Dispatcher_Interface::addParam()
  Add a parameter with which to instantiate an Action Controller

dispatch (line 294)

Dispatch to a controller/action

- access: public

boolean dispatch (Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response)

- 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 119)

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

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 104)

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.

getControllerDirectory (line 167)

Return the currently set directory for Zend_Controller_Action class lookup

- access: public

string getControllerDirectory ()
getDefaultAction (line 282)

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 261)

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)

getParams (line 218)

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

getResponse (line 240)

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

isDispatchable (line 180)

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

unknown isDispatchable (Zend_Controller_Request_Abstract $request, Zend_Controller_Request_Abstract $action)

- Zend_Controller_Request_Abstract $action
- Zend_Controller_Request_Abstract $request

Implementation of:

Zend_Controller_Dispatcher_Interface::isDispatchable()
  Returns TRUE if an action can be dispatched, or FALSE otherwise.

setControllerDirectory (line 151)

Sets the directory where the Zend_Controller_Action class files are stored.

- access: public

self setControllerDirectory (string $dir)

- string $dir

setDefaultAction (line 272)

Set the default action (minus any formatting)

- access: public

self setDefaultAction (string $action)

- string $action

Implementation of:

Zend_Controller_Dispatcher_Interface::setDefaultAction()
  Set default action name (minus formatting)

setDefaultController (line 251)

Set the default controller (minus any formatting)

- access: public

self setDefaultController (string $controller)

- string $controller

Implementation of:

Zend_Controller_Dispatcher_Interface::setDefaultController()
  Set default controller name (minus formatting)

setParams (line 207)

Set parameters to pass to action controller constructors

- access: public

self setParams ( $params)

- array $params

Implementation of:

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

setResponse (line 229)

Set response object to pass to action controllers

- access: public

self setResponse ([Zend_Controller_Response_Abstract $response = null])

- Zend_Controller_Response_Abstract|null $response

Implementation of:

Zend_Controller_Dispatcher_Interface::setResponse()
  Set the response object to use, if any

_dispatch (line 315)

If $performDispatch is FALSE, this method will check if a controller file exists. This still doesn't necessarily mean that it can be dispatched in the stricted sense, as file may not contain the controller class or the controller may reject the action.

If $performDispatch is TRUE, then this method will actually instantiate the controller and call its action. Calling the action is done by passing a Zend_Controller_Dispatcher_Token to the controller's constructor.

- access: protected

void _dispatch (Zend_Controller_Request_Abstract $request, [boolean $performDispatch = true])

- Zend_Controller_Request_Abstract $request
- boolean $performDispatch

_formatName (line 134)

Formats a string from a URI into a PHP-friendly name. Replaces words separated by "-" or "." with camelCaps, title-cases words separated by underscores, and removes any characters that are not alphanumeric.

- access: protected

string _formatName (string $unformatted)

- string $unformatted

Documentation generated on Sun, 29 Oct 2006 21:27:54 -0600 by phpDocumentor 1.3.0RC6