CmsRoute
in package
implements
ArrayAccess
Simple global convenience object to hold information for a single route.
Tags
Table of Contents
Interfaces
- ArrayAccess
Properties
Methods
- __construct() : mixed
- Construct a new route object.
- get_content() : int
- Retrieve the page id, if the destination is a content page.
- get_defaults() : array<string|int, mixed>
- Retrieve the default parameters for this route
- get_dest() : string
- Retrieve the destination module name.
- get_results() : array<string|int, mixed>
- Get matching parameter results.
- get_term() : string
- Returns the route term (string or regex)
- is_content() : bool
- Test whether this route is for a page.
- matches() : bool
- Test if this route matches the specified string Depending upon the route, either a string comparison or regular expression match is performed.
- new_builder() : CmsRoute
- Static convenience function to create a new route.
- signature() : string
- Return the signature for a route
Properties
$defaults
public
array<string|int, mixed>
$defaults
$key1
public
string
$key1
$key2
public
string
$key2
$key3
public
string
$key3
$term
public
string
$term
Methods
__construct()
Construct a new route object.
public
__construct(string $term[, string $key1 = '' ][, array<string|int, mixed> $defaults = null ][, bool $is_absolute = FALSE ][, string $key2 = null ][, string $key3 = null ]) : mixed
Parameters
- $term : string
-
The route string (or regular expression)
- $key1 : string = ''
-
The first key. Usually a module name.
- $defaults : array<string|int, mixed> = null
-
An array of parameter defaults for this module. Only applicable when the destination is a module.
- $is_absolute : bool = FALSE
-
Flag indicating wether the term is a regular expression or an absolute string.
- $key2 : string = null
-
The second key.
- $key3 : string = null
-
The second key.
get_content()
Retrieve the page id, if the destination is a content page.
public
get_content() : int
Attributes
- #[ReturnTypeWillChange]
Return values
int —Page id, or null.
get_defaults()
Retrieve the default parameters for this route
public
get_defaults() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed> —The default parameters for the route.. Null if no defaults specified.
get_dest()
Retrieve the destination module name.
public
get_dest() : string
Attributes
- #[ReturnTypeWillChange]
Return values
string —Destination module name. or null.
get_results()
Get matching parameter results.
public
get_results() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed> —Matching parameters... or Null
get_term()
Returns the route term (string or regex)
public
get_term() : string
Return values
stringis_content()
Test whether this route is for a page.
public
is_content() : bool
Return values
boolmatches()
Test if this route matches the specified string Depending upon the route, either a string comparison or regular expression match is performed.
public
matches(string $str[, bool $exact = false ]) : bool
Parameters
- $str : string
-
The input string
- $exact : bool = false
-
Perform an exact string match rather than depending on the route values.
Return values
boolnew_builder()
Static convenience function to create a new route.
public
static & new_builder(string $term, string $key1[, string $key2 = '' ][, array<string|int, mixed> $defaults = null ][, bool $is_absolute = FALSE ][, string $key3 = '' ]) : CmsRoute
Parameters
- $term : string
-
The route string (or regular expression)
- $key1 : string
-
The first key. Usually a module name
- $key2 : string = ''
-
The second key
- $defaults : array<string|int, mixed> = null
-
An array of parameter defaults for this module. Only applicable when the destination is a module
- $is_absolute : bool = FALSE
-
Flag indicating wether the term is a regular expression or an absolute string
- $key3 : string = ''
-
The second key
Return values
CmsRoutesignature()
Return the signature for a route
public
signature() : string