PHP Class ManaPHP\Mvc\Router\Route

Inheritance: implements ManaPHP\Mvc\Router\RouteInterface
Show file Open project: manaphp/manaphp

Protected Properties

Property Type Description
$_compiledPattern string
$_httpMethod string
$_paths array
$_pattern string

Public Methods

Method Description
__construct ( string $pattern, string | array $paths = null, string $httpMethod = null ) \ManaPHP\Mvc\Router\Route constructor
getPaths ( ) : array Returns the paths
getRoutePaths ( string | array $paths = null ) : array Returns routePaths
match ( string $uri ) : boolean | array

Protected Methods

Method Description
_compilePattern ( string $pattern ) : string Replaces placeholders from pattern returning a valid PCRE regular expression
_extractNamedParams ( string $pattern ) : string Extracts parameters from a string

Method Details

__construct() public method

\ManaPHP\Mvc\Router\Route constructor
public __construct ( string $pattern, string | array $paths = null, string $httpMethod = null )
$pattern string
$paths string | array
$httpMethod string

_compilePattern() protected method

Replaces placeholders from pattern returning a valid PCRE regular expression
protected _compilePattern ( string $pattern ) : string
$pattern string
return string

_extractNamedParams() protected method

Extracts parameters from a string
protected _extractNamedParams ( string $pattern ) : string
$pattern string
return string

getPaths() public method

Returns the paths
public getPaths ( ) : array
return array

getRoutePaths() public static method

Returns routePaths
public static getRoutePaths ( string | array $paths = null ) : array
$paths string | array
return array

match() public method

public match ( string $uri ) : boolean | array
$uri string
return boolean | array

Property Details

$_compiledPattern protected property

protected string $_compiledPattern
return string

$_httpMethod protected property

protected string $_httpMethod
return string

$_paths protected property

protected array $_paths
return array

$_pattern protected property

protected string $_pattern
return string