API Documentation

Controller/Dispatcher/Standard.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Controller
subpackage
Dispatcher
version
$Id: Standard.php 22039 2010-04-28 18:56:43Z matthew $
Classes
Zend_Controller_Dispatcher_Standard

Description

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.

Zend_Controller_Dispatcher_Standard

Extends from
Zend_Controller_Dispatcher_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Controller
subpackage
Dispatcher
Properties
$_curDirectory
$_curModule
$_controllerDirectory
Methods
__construct
addControllerDirectory
setControllerDirectory
getControllerDirectory
removeControllerDirectory
formatModuleName
formatClassName
classToFilename
isDispatchable
dispatch
loadClass
getControllerClass
isValidModule
getDefaultControllerClass
getDispatchDirectory
getActionMethod

Description

Properties

$_controllerDirectory

array $_controllerDirectory = 'array'

Controller directory(ies)

Details

$_controllerDirectory
array
visibility
protected
default
array
final
false
static
false

$_curDirectory

string $_curDirectory = ''

Current dispatchable directory

Details

$_curDirectory
string
visibility
protected
default
final
false
static
false

$_curModule

string $_curModule = ''

Current module (formatted)

Details

$_curModule
string
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( array $params = array ) : void

Constructor: Set current module to default value

Arguments
$params
array
Details
visibility
public
final
false
static
false

addControllerDirectory

addControllerDirectory( string $path, string $module = null ) : Zend_Controller_Dispatcher_Standard

Add a single path to the controller directory stack

Arguments
$path
string
$module
string
Details
visibility
public
final
false
static
false

classToFilename

classToFilename( string $class ) : string

Convert a class name to a filename

Arguments
$class
string
Output
string
Details
visibility
public
final
false
static
false

dispatch

dispatch( Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response ) : void

Dispatch to a controller/action

By default, if a controller is not dispatchable, dispatch() will throw an exception. If you wish to use the default controller instead, set the param 'useDefaultControllerAlways' via {@link setParam()}.

Arguments
$request
Zend_Controller_Request_Abstract
$response
Zend_Controller_Response_Abstract
Details
visibility
public
final
false
static
false
throws

formatClassName

formatClassName( string $moduleName, string $className ) : string

Format action class name

Arguments
$moduleName
string
Name of the current module
$className
string
Name of the action class
Output
string
Formatted class name
Details
visibility
public
final
false
static
false

formatModuleName

formatModuleName( string $unformatted ) : string

Format the module name.

Arguments
$unformatted
string
Output
string
Details
visibility
public
final
false
static
false

getActionMethod

getActionMethod( Zend_Controller_Request_Abstract $request ) : string

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

Arguments
$request
Zend_Controller_Request_Abstract
Output
string
Details
visibility
public
final
false
static
false

getControllerClass

getControllerClass( Zend_Controller_Request_Abstract $request ) : string|false

Get controller class name

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

Arguments
$request
Zend_Controller_Request_Abstract
Output
string|false
Returns class name on success
Details
visibility
public
final
false
static
false

getControllerDirectory

getControllerDirectory( string $module = null ) : array|string

Return the currently set directories for Zend_Controller_Action class lookup

If a module is specified, returns just that directory.

Arguments
$module
string
Module name
Output
array|string
Returns array of all directories by default, single module directory if module argument provided
Details
visibility
public
final
false
static
false

getDefaultControllerClass

getDefaultControllerClass( Zend_Controller_Request_Abstract $request ) : string

Retrieve default controller class

Determines whether the default controller to use lies within the requested module, or if the global default should be used.

By default, will only use the module default unless that controller does not exist; if this is the case, it falls back to the default controller in the default module.

Arguments
$request
Zend_Controller_Request_Abstract
Output
string
Details
visibility
public
final
false
static
false

getDispatchDirectory

getDispatchDirectory( ) : string

Return the value of the currently selected dispatch directory (as set by {@link getController()})

Output
string
Details
visibility
public
final
false
static
false

isDispatchable

isDispatchable(  $request ) : boolean

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

Use this method wisely. By default, the dispatcher will fall back to the default controller (either in the module specified or the global default) if a given controller does not exist. This method returning false does not necessarily indicate the dispatcher will not still dispatch the call.

Arguments
$request
Output
boolean
Details
visibility
public
final
false
static
false

isValidModule

isValidModule( string $module ) : bool

Determine if a given module is valid

Arguments
$module
string
Output
bool
Details
visibility
public
final
false
static
false

loadClass

loadClass( string $className ) : string

Load a controller class

Attempts to load the controller class file from {@link getControllerDirectory()}. If the controller belongs to a module, looks for the module prefix to the controller class.

Arguments
$className
string
Output
string
Class name loaded
Details
visibility
public
final
false
static
false
throws
if class not loaded

removeControllerDirectory

removeControllerDirectory( string $module ) : bool

Remove a controller directory by module name

Arguments
$module
string
Output
bool
Details
visibility
public
final
false
static
false

setControllerDirectory

setControllerDirectory( array|string $directory,  $module = null ) : Zend_Controller_Dispatcher_Standard

Set controller directory

Arguments
$directory
arraystring
$module
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.