Property | Type | Description | |
---|---|---|---|
$defaults | array | Default parameters for a Route | |
$keys | array | /:controller/:action/:id has 3 key elements | |
$options | array | An array of additional parameters for the Route. | |
$template | string | The routes template string. |
Property | Type | Description | |
---|---|---|---|
$_compiledRoute | string | The compiled route regular expression | |
$_extensions | array | List of connected extensions for this route. | |
$_greedy | string | Is this route a greedy route? Greedy routes have a /* in their template | |
$_name | string | The name for a route. Fetch with Route::getName(); |
Method | Description | |
---|---|---|
__construct ( string $template, array | string $defaults = [], array $options = [] ) | Constructor for a Route | |
__set_state ( array $fields ) : |
Set state magic method to support var_export | |
compile ( ) : array | Compiles the route's regular expression. | |
compiled ( ) : boolean | Check if a Route has been compiled into a regular expression. | |
extensions ( null | string | array $extensions = null ) : array | null | Get/Set the supported extensions for this route. | |
getExtensions ( ) : array | Get the supported extensions for this route. | |
getName ( ) : string | Get the standardized plugin.controller:action name for a route. | |
match ( array $url, array $context = [] ) : string | false | Check if a URL array matches this route instance. | |
parse ( string $url, string $method = '' ) : array | false | Checks to see if the given URL can be parsed by this route. | |
setExtensions ( array $extensions ) | Set the supported extensions for this route. | |
staticPath ( ) : string | Get the static path portion for this route. |
Method | Description | |
---|---|---|
_matchMethod ( array $url ) : boolean | Check whether or not the URL's HTTP method matches. | |
_parseArgs ( string $args, string $context ) : array | Parse passed parameters into a list of passed args. | |
_parseExtension ( string $url ) : array | Removes the extension from $url if it contains a registered extension. | |
_persistParams ( array $url, array $params ) : array | Apply persistent parameters to a URL array. Persistent parameters are a special key used during route creation to force route parameters to persist when omitted from a URL array. | |
_writeRoute ( ) : void | Builds a route regular expression. | |
_writeUrl ( array $params, array $pass = [], array $query = [] ) : string | Converts a matching route array into a URL string. |
public static __set_state ( array $fields ) : |
||
$fields | array | Key/Value of object attributes |
return | A new instance of the route |
protected _matchMethod ( array $url ) : boolean | ||
$url | array | The array for the URL being generated. |
return | boolean |
protected _parseExtension ( string $url ) : array | ||
$url | string | The url to parse. |
return | array | containing url, extension |
protected _writeRoute ( ) : void | ||
return | void |
public getExtensions ( ) : array | ||
return | array |
public match ( array $url, array $context = [] ) : string | false | ||
$url | array | An array of parameters to check matching with. |
$context | array | An array of the current request context. Contains information such as the current host, scheme, port, base directory and other url params. |
return | string | false | Either a string URL for the parameters if they match or false. |
public setExtensions ( array $extensions ) | ||
$extensions | array | The extensions to set. |
public staticPath ( ) : string | ||
return | string |
protected string $_compiledRoute | ||
return | string |
protected array $_extensions | ||
return | array |
protected string $_greedy | ||
return | string |
protected string $_name | ||
return | string |
public array $keys | ||
return | array |
public array $options | ||
return | array |