API Documentation

Controller/Router/Route.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
Router
version
$Id: Route.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Controller_Router_Route

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_Router_Route

Extends from
Zend_Controller_Router_Route_Abstract
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
see
http://manuals.rubyonrails.com/read/chapter/65
subpackage
Router
Properties
$_defaultTranslator
$_translator
$_defaultLocale
$_locale
$_isTranslated
$_translatable
$_urlVariable
$_urlDelimiter
$_regexDelimiter
$_defaultRegex
$_variables
$_parts
$_defaults
$_requirements
$_values
$_wildcardData
$_staticCount
Methods
getVersion
getInstance
__construct
match
assemble
getDefault
getDefaults
getVariables
setDefaultTranslator
getDefaultTranslator
setTranslator
getTranslator
setDefaultLocale
getDefaultLocale
setLocale
getLocale

Description

Route

Properties

$_defaultLocale

mixed $_defaultLocale = ''

Default locale

Details

$_defaultLocale
mixed
visibility
protected
default
final
false
static
true

$_defaultRegex

 $_defaultRegex = 'null'

Details

visibility
protected
default
null
final
false
static
false

$_defaultTranslator

Zend_Translate $_defaultTranslator = ''

Default translator

Details

$_defaultTranslator
Zend_Translate
visibility
protected
default
final
false
static
true

$_defaults

array $_defaults = 'array'

Holds user submitted default values for route's variables. Name and value pairs.

Details

$_defaults
array
visibility
protected
default
array
final
false
static
false

$_isTranslated

boolean $_isTranslated = 'false'

Wether this is a translated route or not

Details

$_isTranslated
boolean
visibility
protected
default
false
final
false
static
false

$_locale

mixed $_locale = ''

Locale

Details

$_locale
mixed
visibility
protected
default
final
false
static
false

$_parts

array $_parts = 'array'

Holds Route patterns for all URL parts. In case of a variable it stores it's regex requirement or null. In case of a static part, it holds only it's direct value.

In case of a wildcard, it stores an asterisk (*)

Details

$_parts
array
visibility
protected
default
array
final
false
static
false

$_regexDelimiter

 $_regexDelimiter = '#'

Details

visibility
protected
default
#
final
false
static
false

$_requirements

array $_requirements = 'array'

Holds user submitted regular expression patterns for route's variables' values.

Name and value pairs.

Details

$_requirements
array
visibility
protected
default
array
final
false
static
false

$_staticCount

int $_staticCount = '0'

Helper var that holds a count of route pattern's static parts for validation

Details

$_staticCount
int
visibility
protected
default
0
final
false
static
false

$_translatable

array $_translatable = 'array'

Translatable variables

Details

$_translatable
array
visibility
protected
default
array
final
false
static
false

$_translator

Zend_Translate $_translator = ''

Translator

Details

$_translator
Zend_Translate
visibility
protected
default
final
false
static
false

$_urlDelimiter

 $_urlDelimiter = '/'

Details

visibility
protected
default
/
final
false
static
false

$_urlVariable

 $_urlVariable = ':'

Details

visibility
protected
default
:
final
false
static
false

$_values

array $_values = 'array'

Associative array filled on match() that holds matched path values for given variable names.

Details

$_values
array
visibility
protected
default
array
final
false
static
false

$_variables

array $_variables = 'array'

Holds names of all route's pattern variable names. Array index holds a position in URL.

Details

$_variables
array
visibility
protected
default
array
final
false
static
false

$_wildcardData

array $_wildcardData = 'array'

Associative array filled on match() that holds wildcard variable names and values.

Details

$_wildcardData
array
visibility
protected
default
array
final
false
static
false

Methods

__construct

__construct( string $route, array $defaults = array, array $reqs = array, Zend_Translate $translator = null,  $locale = null ) :

Prepares the route for mapping by splitting (exploding) it to a corresponding atomic parts. These parts are assigned a position which is later used for matching and preparing values.

Arguments
$route
string
Map used to match with later submitted URL path
$defaults
array
Defaults for map variables with keys as variable names
$reqs
array
Regular expression requirements for variables (keys as variable names)
$translator
Zend_Translate
Translator to use for this instance
$locale
Details
visibility
public
final
false
static
false

assemble

assemble( array $data = array, boolean $reset = false,  $encode = false,  $partial = false ) : string

Assembles user submitted parameters forming a URL path defined by this route

Arguments
$data
array
An array of variable and value pairs used as parameters
$reset
boolean
Whether or not to set route defaults with those provided in $data
$encode
$partial
Output
string
Route path with user submitted parameters
Details
visibility
public
final
false
static
false

getDefault

getDefault( string $name ) : string

Return a single parameter of route's defaults

Arguments
$name
string
Array key of the parameter
Output
string
Previously set default
Details
visibility
public
final
false
static
false

getDefaultLocale

getDefaultLocale( ) : mixed

Get the default locale

Output
mixed
Details
visibility
public
final
false
static
true

getDefaultTranslator

getDefaultTranslator( ) : Zend_Translate

Get the default translator

Details
visibility
public
final
false
static
true

getDefaults

getDefaults( ) : array

Return an array of defaults

Output
array
Route defaults
Details
visibility
public
final
false
static
false

getInstance

getInstance( Zend_Config $config ) :

Instantiates route based on passed Zend_Config structure

Arguments
$config
Zend_Config
Configuration object
Details
visibility
public
final
false
static
true

getLocale

getLocale( ) : mixed

Get the locale

Output
mixed
Details
visibility
public
final
false
static
false

getTranslator

getTranslator( ) : Zend_Translate

Get the translator

Details
visibility
public
final
false
static
false
throws
When no translator can be found

getVariables

getVariables( ) : array

Get all variables which are used by the route

Output
array
Details
visibility
public
final
false
static
false

getVersion

getVersion( ) :
Details
visibility
public
final
false
static
false

match

match( string $path,  $partial = false ) : array|false

Matches a user submitted path with parts defined by a map. Assigns and returns an array of variables on a successful match.

Arguments
$path
string
Path used to match against this routing map
$partial
Output
array|false
An array of assigned values or a false on a mismatch
Details
visibility
public
final
false
static
false

setDefaultLocale

setDefaultLocale( mixed $locale = null ) : void

Set a default locale

Arguments
$locale
mixed
Details
visibility
public
final
false
static
true

setDefaultTranslator

setDefaultTranslator( Zend_Translate $translator = null ) : void

Set a default translator

Arguments
$translator
Zend_Translate
Details
visibility
public
final
false
static
true

setLocale

setLocale( mixed $locale ) : void

Set a locale

Arguments
$locale
mixed
Details
visibility
public
final
false
static
false

setTranslator

setTranslator( Zend_Translate $translator ) : void

Set a translator

Arguments
$translator
Zend_Translate
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.