API Documentation

Controller/Dispatcher/Abstract.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Controller  
subpackage
Dispatcher  
version
$Id: Abstract.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Controller_Dispatcher_Abstract

Implements
\Zend_Controller_Dispatcher_Interface
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Controller  
subpackage
Dispatcher  

Properties

Propertyprotectedstring  $_defaultAction= 'index'

Default action

Default valueindexDetails
Type
string
Propertyprotectedstring  $_defaultController= 'index'

Default controller

Default valueindexDetails
Type
string
Propertyprotectedstring  $_defaultModule= 'default'

Default module

Default valuedefaultDetails
Type
string
Propertyprotected\Zend_Controller_Front  $_frontController= ''

Front Controller instance

Details
Type
\Zend_Controller_Front
Propertyprotectedarray  $_invokeParams= 'array'

Array of invocation parameters to use when instantiating action controllers

Default valuearrayDetails
Type
array
Propertyprotectedstring  $_pathDelimiter= '_'

Path delimiter character

Default value_Details
Type
string
Propertyprotected\Zend_Controller_Response_Abstract|null  $_response= 'null'

Response object to pass to action controllers, if any

Default valuenullDetails
Type
\Zend_Controller_Response_Abstractnull
Propertyprotectedarray  $_wordDelimiter= 'array'

Word delimiter characters

Default valuearrayDetails
Type
array

Methods

methodpublic__construct(  $params = array ) : void

Constructor

Parameters
Name Type Description
$params
methodprotected_formatName( string $unformatted, boolean $isAction = false ) : string

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
Name Type Description
$unformatted string
$isAction boolean Defaults to false
Returns
Type Description
string
methodpublic_verifyDelimiter( string|array $spec ) : array

Verify delimiter

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

Parameters
Name Type Description
$spec string|array
Returns
Type Description
array
Throws
Exception Description
\Zend_Controller_Dispatcher_Exception with invalid delimiters
methodpublicaddControllerDirectory( string $path, string $args = null ) : \Zend_Controller_Dispatcher_Interface

Add a controller directory to the controller directory stack

Inherited from: \Zend_Controller_Dispatcher_Interface::addControllerDirectory()
Parameters
Name Type Description
$path string
$args string
Returns
Type Description
\Zend_Controller_Dispatcher_Interface
methodpublicclearParams( null|string|array $name = null ) : \Zend_Controller_Dispatcher_Abstract

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
Name Type Description
$name null|string|array single key or array of keys for params to clear
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicdispatch( \Zend_Controller_Request_Abstract $request, \Zend_Controller_Response_Abstract $response ) : void

Dispatches a request object to a controller/action. If the action requests a forward to another action, a new request will be returned.

Inherited from: \Zend_Controller_Dispatcher_Interface::dispatch()
Parameters
Name Type Description
$request \Zend_Controller_Request_Abstract
$response \Zend_Controller_Response_Abstract
methodpublicformatActionName( string $unformatted ) : string

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
Name Type Description
$unformatted string
Returns
Type Description
string
methodpublicformatControllerName( string $unformatted ) : string

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
Name Type Description
$unformatted string
Returns
Type Description
string
methodpublicformatModuleName( string $unformatted ) : string

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 directory/class name that a class extending Zend_Controller_Action would use.

Inherited from: \Zend_Controller_Dispatcher_Interface::formatModuleName()
Parameters
Name Type Description
$unformatted string
Returns
Type Description
string
methodpublicgetControllerDirectory( ) : array

Return the currently set directory(ies) for controller file lookup

Inherited from: \Zend_Controller_Dispatcher_Interface::getControllerDirectory()
Returns
Type Description
array
methodpublicgetDefaultAction( ) : string

Retrieve the default action name (minus formatting)

Returns
Type Description
string
methodpublicgetDefaultControllerName( ) : string

Retrieve the default controller name (minus formatting)

Returns
Type Description
string
methodpublicgetDefaultModule( ) : string

Retrieve the default module

Returns
Type Description
string
methodpublicgetFrontController( ) : \Zend_Controller_Front

Retrieve front controller instance

Returns
Type Description
\Zend_Controller_Front
methodpublicgetParam( string $name ) : mixed

Retrieve a single parameter from the controller parameter stack

Parameters
Name Type Description
$name string
Returns
Type Description
mixed
methodpublicgetParams( ) : array

Retrieve action controller instantiation parameters

Returns
Type Description
array
methodpublicgetPathDelimiter( ) : array

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

Returns
Type Description
array
methodpublicgetResponse( ) : \Zend_Controller_Response_Abstract|null

Return the registered response object

Returns
Type Description
\Zend_Controller_Response_Abstractnull
methodpublicgetWordDelimiter( ) : array

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

Returns
Type Description
array
methodpublicisDispatchable( \Zend_Controller_Request_Abstract $request ) : boolean

Returns TRUE if an action can be dispatched, or FALSE otherwise.

Inherited from: \Zend_Controller_Dispatcher_Interface::isDispatchable()
Parameters
Name Type Description
$request \Zend_Controller_Request_Abstract
Returns
Type Description
boolean
methodpublicisValidModule( string $module ) : boolean

Whether or not a given module is valid

Inherited from: \Zend_Controller_Dispatcher_Interface::isValidModule()
Parameters
Name Type Description
$module string
Returns
Type Description
boolean
methodpublicsetControllerDirectory(  $path ) : \Zend_Controller_Dispatcher_Interface

Set the directory where controller files are stored

Inherited from: \Zend_Controller_Dispatcher_Interface::setControllerDirectory()

Specify a string or an array; if an array is specified, all paths will be added.

Parameters
Name Type Description
$path
Returns
Type Description
\Zend_Controller_Dispatcher_Interface
methodpublicsetDefaultAction( string $action ) : \Zend_Controller_Dispatcher_Abstract

Set the default action (minus any formatting)

Parameters
Name Type Description
$action string
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicsetDefaultControllerName( string $controller ) : \Zend_Controller_Dispatcher_Abstract

Set the default controller (minus any formatting)

Parameters
Name Type Description
$controller string
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicsetDefaultModule( string $module ) : \Zend_Controller_Dispatcher_Abstract

Set the default module

Parameters
Name Type Description
$module string
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicsetFrontController( \Zend_Controller_Front $controller ) : \Zend_Controller_Dispatcher_Abstract

Set front controller instance

Parameters
Name Type Description
$controller \Zend_Controller_Front
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicsetParam( string $name, mixed $value ) : \Zend_Controller_Dispatcher_Abstract

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

Parameters
Name Type Description
$name string
$value mixed
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicsetParams( array $params ) : \Zend_Controller_Dispatcher_Abstract

Set parameters to pass to action controller constructors

Parameters
Name Type Description
$params array
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicsetPathDelimiter( string $spec ) : \Zend_Controller_Dispatcher_Abstract

Set path delimiter

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

Parameters
Name Type Description
$spec string
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicsetResponse( \Zend_Controller_Response_Abstract|null $response = null ) : \Zend_Controller_Dispatcher_Abstract

Set response object to pass to action controllers

Parameters
Name Type Description
$response \Zend_Controller_Response_Abstract|null
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
methodpublicsetWordDelimiter( string|array $spec ) : \Zend_Controller_Dispatcher_Abstract

Set word delimiter

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

Parameters
Name Type Description
$spec string|array
Returns
Type Description
\Zend_Controller_Dispatcher_Abstract
Documentation was generated by DocBlox 0.13.3.