Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Controller_Dispatcher_Abstract Class Reference

Public Member Functions

 __construct (array $params=array())
 Constructor.
 
 formatControllerName ($unformatted)
 Formats a string into a controller name.
 
 formatActionName ($unformatted)
 Formats a string into an action name.
 
 _verifyDelimiter ($spec)
 Verify delimiter.
 
 getWordDelimiter ()
 Retrieve the word delimiter character(s) used in controller or action names.
 
 setWordDelimiter ($spec)
 Set word delimiter.
 
 getPathDelimiter ()
 Retrieve the path delimiter character(s) used in controller names.
 
 setPathDelimiter ($spec)
 Set path delimiter.
 
 getFrontController ()
 Retrieve front controller instance.
 
 setFrontController (Zend_Controller_Front $controller)
 Set front controller instance.
 
 setParam ($name, $value)
 Add or modify a parameter to use when instantiating an action controller.
 
 setParams (array $params)
 Set parameters to pass to action controller constructors.
 
 getParam ($name)
 Retrieve a single parameter from the controller parameter stack.
 
 getParams ()
 Retrieve action controller instantiation parameters.
 
 clearParams ($name=null)
 Clear the controller parameter stack.
 
 setResponse (Zend_Controller_Response_Abstract $response=null)
 Set response object to pass to action controllers.
 
 getResponse ()
 Return the registered response object.
 
 setDefaultControllerName ($controller)
 Set the default controller (minus any formatting)
 
 getDefaultControllerName ()
 Retrieve the default controller name (minus formatting)
 
 setDefaultAction ($action)
 Set the default action (minus any formatting)
 
 getDefaultAction ()
 Retrieve the default action name (minus formatting)
 
 setDefaultModule ($module)
 Set the default module.
 
 getDefaultModule ()
 Retrieve the default module.
 
- Public Member Functions inherited from Zend_Controller_Dispatcher_Interface
 formatModuleName ($unformatted)
 Formats a string into a module name.
 
 isDispatchable (Zend_Controller_Request_Abstract $request)
 Returns TRUE if an action can be dispatched, or FALSE otherwise.
 
 addControllerDirectory ($path, $args=null)
 Add a controller directory to the controller directory stack.
 
 setControllerDirectory ($path)
 Set the directory where controller files are stored.
 
 getControllerDirectory ()
 Return the currently set directory(ies) for controller file lookup.
 
 dispatch (Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response)
 Dispatches a request object to a controller/action.
 
 isValidModule ($module)
 Whether or not a given module is valid.
 

Protected Member Functions

 _formatName ($unformatted, $isAction=false)
 Formats a string from a URI into a PHP-friendly name.
 

Protected Attributes

 $_defaultAction = 'index'
 
 $_defaultController = 'index'
 
 $_defaultModule = 'default'
 
 $_frontController
 
 $_invokeParams = array()
 
 $_pathDelimiter = '_'
 
 $_response = null
 
 $_wordDelimiter = array('-', '.')
 

Constructor & Destructor Documentation

__construct ( array  $params = array())

Constructor.

Returns
void

Member Function Documentation

_formatName (   $unformatted,
  $isAction = false 
)
protected

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

By default, replaces words separated by the word separator character(s) with camelCaps. If $isAction is false, it also preserves replaces words separated by the path separation character with an underscore, making the following word Title cased. All non-alphanumeric characters are removed.

Parameters
string$unformatted
boolean$isActionDefaults to false
Returns
string
_verifyDelimiter (   $spec)

Verify delimiter.

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

Parameters
string | array$spec
Returns
array
Exceptions
Zend_Controller_Dispatcher_Exceptionwith invalid delimiters
clearParams (   $name = null)

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.

Parameters
null|string|arraysingle key or array of keys for params to clear
Returns
Zend_Controller_Dispatcher_Abstract

Implements Zend_Controller_Dispatcher_Interface.

formatActionName (   $unformatted)

Formats a string into an action name.

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

Parameters
string$unformatted
Returns
string

Implements Zend_Controller_Dispatcher_Interface.

formatControllerName (   $unformatted)

Formats a string into a controller name.

This is used to take a raw controller name, such as one stored inside a Zend_Controller_Request_Abstract object, and reformat it to a proper class name that a class extending Zend_Controller_Action would use.

Parameters
string$unformatted
Returns
string

Implements Zend_Controller_Dispatcher_Interface.

getDefaultAction ( )

Retrieve the default action name (minus formatting)

Returns
string

Implements Zend_Controller_Dispatcher_Interface.

getDefaultControllerName ( )

Retrieve the default controller name (minus formatting)

Returns
string

Implements Zend_Controller_Dispatcher_Interface.

getDefaultModule ( )

Retrieve the default module.

Returns
string

Implements Zend_Controller_Dispatcher_Interface.

getFrontController ( )

Retrieve front controller instance.

Returns
Zend_Controller_Front
getParam (   $name)

Retrieve a single parameter from the controller parameter stack.

Parameters
string$name
Returns
mixed

Implements Zend_Controller_Dispatcher_Interface.

getParams ( )

Retrieve action controller instantiation parameters.

Returns
array

Implements Zend_Controller_Dispatcher_Interface.

getPathDelimiter ( )

Retrieve the path delimiter character(s) used in controller names.

Returns
array
getResponse ( )

Return the registered response object.

Returns
Zend_Controller_Response_Abstract|null

Implements Zend_Controller_Dispatcher_Interface.

getWordDelimiter ( )

Retrieve the word delimiter character(s) used in controller or action names.

Returns
array
setDefaultAction (   $action)

Set the default action (minus any formatting)

Parameters
string$action
Returns
Zend_Controller_Dispatcher_Abstract
setDefaultControllerName (   $controller)

Set the default controller (minus any formatting)

Parameters
string$controller
Returns
Zend_Controller_Dispatcher_Abstract
setDefaultModule (   $module)

Set the default module.

Parameters
string$module
Returns
Zend_Controller_Dispatcher_Abstract
setFrontController ( Zend_Controller_Front  $controller)

Set front controller instance.

Parameters
Zend_Controller_Front$controller
Returns
Zend_Controller_Dispatcher_Abstract
setParam (   $name,
  $value 
)

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

Parameters
string$name
mixed$value
Returns
Zend_Controller_Dispatcher_Abstract

Implements Zend_Controller_Dispatcher_Interface.

setParams ( array  $params)

Set parameters to pass to action controller constructors.

Parameters
array$params
Returns
Zend_Controller_Dispatcher_Abstract

Implements Zend_Controller_Dispatcher_Interface.

setPathDelimiter (   $spec)

Set path delimiter.

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

Parameters
string$spec
Returns
Zend_Controller_Dispatcher_Abstract
setResponse ( Zend_Controller_Response_Abstract  $response = null)

Set response object to pass to action controllers.

Parameters
Zend_Controller_Response_Abstract | null$response
Returns
Zend_Controller_Dispatcher_Abstract

Implements Zend_Controller_Dispatcher_Interface.

setWordDelimiter (   $spec)

Set word delimiter.

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

Parameters
string | array$spec
Returns
Zend_Controller_Dispatcher_Abstract

Member Data Documentation

$_defaultAction = 'index'
protected
$_defaultController = 'index'
protected
$_defaultModule = 'default'
protected
$_frontController
protected
$_invokeParams = array()
protected
$_pathDelimiter = '_'
protected
$_response = null
protected
$_wordDelimiter = array('-', '.')
protected