Controller/Dispatcher/Abstract.php

Show: inherited
Table of Contents

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 [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Controller  
Subpackage
Dispatcher  
Version
$Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Controller_Dispatcher_Abstract

Package: Zend\Controller\Dispatcher

Implements
\Zend_Controller_Dispatcher_Interface
Children
\Zend_Controller_Dispatcher_Standard
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotectedstring $_defaultAction = 'index'

Default action

Default value'index'Details
Type
string
Propertyprotectedstring $_defaultController = 'index'

Default controller

Default value'index'Details
Type
string
Propertyprotectedstring $_defaultModule = 'default'

Default module

Default value'default'Details
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 valuearray()Details
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_Abstract | null
Propertyprotectedarray $_wordDelimiter = array('-', '.')

Word delimiter characters

Default valuearray('-', '.')Details
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
inherited

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
inherited

Dispatches a request object to a controller/action.

Inherited from: \Zend_Controller_Dispatcher_Interface::dispatch()

If the action requests a forward to another action, a new request will be returned.

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
inherited

Formats a string into a module name.

Inherited from: \Zend_Controller_Dispatcher_Interface::formatModuleName()

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.

Parameters
Name Type Description
$unformatted string
Returns
Type Description
string
methodpublicgetControllerDirectory() : array
inherited

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_Abstract | null
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
inherited

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
inherited

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
inherited

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 phpDocumentor 2.0.0a8.