CmsRoute View code

Implements \ArrayAccess

Simple global convenience object to hold information for a single route.

package

CMS

license

GPL

author

Robert Campbell calguy1000@cmsmadesimple.org

since 1.9

Methods

__construct(string $term, string $key1 = '', array $defaults = null, boolean $is_absolute = FALSE, string $key2 = null, string $key3 = null) 

Construct a new route object.

Arguments

string $term

The route string (or regular expression)

string $key1

The first key. Usually a module name.

array $defaults

An array of parameter defaults for this module. Only applicable when the destination is a module.

boolean $is_absolute

Flag indicating wether the term is a regular expression or an absolute string.

string $key2

The second key.

string $key3

The second key.

new_builder(string $term, string $key1, string $key2 = '', array $defaults = null, boolean $is_absolute = FALSE, string $key3 = '') 

Static convenience function to create a new route.

static

Arguments

string $term

The route string (or regular expression)

string $key1

The first key. Usually a module name

string $key2

The second key

array $defaults

An array of parameter defaults for this module. Only applicable when the destination is a module

boolean $is_absolute

Flag indicating wether the term is a regular expression or an absolute string

string $key3

The second key

signature() 

Return the signature for a route

get_term() : string

Returns the route term (string or regex)

deprecated

Response

string

get_dest() : string

Retrieve the destination module name.

deprecated

Response

string

Destination module name. or null.

get_content() : integer

Retrieve the page id, if the destination is a content page.

deprecated

Response

integer

Page id, or null.

get_defaults() : array

Retrieve the default parameters for this route

deprecated

Response

array

The default parameters for the route.. Null if no defaults specified.

is_content() : boolean

Test wether this route is for a page.

deprecated

Response

boolean

get_results() : array

Get matching parameter results.

deprecated

Response

array

Matching parameters... or Null

matches(string $str, boolean $exact = false) : boolean

Test if this route matches the specified string Depending upon the route, either a string comparison or regular expression match is performed.

Arguments

string $str

The input string

boolean $exact

Perform an exact string match rather than depending on the route values.

Response

boolean

Properties

term

term : string

Type(s)

string

key1

key1 : string

Type(s)

string

key2

key2 : string

Type(s)

string

key3

key3 : string

Type(s)

string

defaults

defaults : array

Type(s)

array

 : string

absolute

Type(s)

string

 : string

results

Type(s)

string