API Documentation

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

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_Hostname

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
$_hostVariable
$_regexDelimiter
$_defaultRegex
$_variables
$_parts
$_defaults
$_requirements
$_scheme
$_values
$_request
$_staticCount
Methods
setRequest
getRequest
getInstance
__construct
match
assemble
getDefault
getDefaults
getVariables

Description

Hostname Route

Properties

$_defaultRegex

 $_defaultRegex = 'null'

Details

visibility
protected
default
null
final
false
static
false

$_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

$_hostVariable

 $_hostVariable = ':'

Details

visibility
protected
default
:
final
false
static
false

$_parts

array $_parts = 'array'

Holds Route patterns for all host 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.

Details

$_parts
array
visibility
protected
default
array
final
false
static
false

$_regexDelimiter

 $_regexDelimiter = '#'

Details

visibility
protected
default
#
final
false
static
false

$_request

Zend_Controller_Request_Abstract $_request = ''

Current request object

Details

$_request
Zend_Controller_Request_Abstract
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

$_scheme

string $_scheme = 'null'

Default scheme

Details

$_scheme
string
visibility
protected
default
null
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
private
default
0
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 host.

Details

$_variables
array
visibility
protected
default
array
final
false
static
false

Methods

__construct

__construct( string $route, array $defaults = array, array $reqs = array, string $scheme = 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 hostname
$defaults
array
Defaults for map variables with keys as variable names
$reqs
array
Regular expression requirements for variables (keys as variable names)
$scheme
string
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 hostname 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

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

getRequest

getRequest( ) : Zend_Controller_Request_Abstract

Get the request object

Details
visibility
public
final
false
static
false

getVariables

getVariables( ) : array

Get all variables which are used by the route

Output
array
Details
visibility
public
final
false
static
false

match

match( Zend_Controller_Request_Http $request ) : 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
$request
Zend_Controller_Request_Http
Request to get the host from
Output
array|false
An array of assigned values or a false on a mismatch
Details
visibility
public
final
false
static
false

setRequest

setRequest( Zend_Controller_Request_Abstract|null $request = null ) : void

Set the request object

Arguments
$request
Zend_Controller_Request_Abstractnull
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.