PHP Class Webiny\Component\Router\Route\CompiledRoute

Show file Open project: Webiny/Framework Class Usage Examples

Public Methods

Method Description
__construct ( string $staticPrefix, string $regex, array $variables, array $extractedRegexes, string | boolean $defaultRoute ) Base constructor.
getDefaultRoute ( ) : string | boolean Returns the default route.
getExtractedRegexes ( ) : array Returns a list of extracted regexes.
getRegex ( ) : string Get the regular expression to match the url.
getStaticPrefix ( ) : string Get the static prefix.
getVariables ( ) : array Get the extracted variables from the path.

Method Details

__construct() public method

Base constructor.
public __construct ( string $staticPrefix, string $regex, array $variables, array $extractedRegexes, string | boolean $defaultRoute )
$staticPrefix string Pattern prefix that doesn't contain regular expression.
$regex string Regular expression that will be matched against the given url.
$variables array List of available variables extracted from the route path.
$extractedRegexes array List of extracted regexes from the route.
$defaultRoute string | boolean A route that contains default values or false.

getDefaultRoute() public method

Returns the default route.
public getDefaultRoute ( ) : string | boolean
return string | boolean

getExtractedRegexes() public method

Returns a list of extracted regexes.
public getExtractedRegexes ( ) : array
return array

getRegex() public method

Get the regular expression to match the url.
public getRegex ( ) : string
return string

getStaticPrefix() public method

Get the static prefix.
public getStaticPrefix ( ) : string
return string

getVariables() public method

Get the extracted variables from the path.
public getVariables ( ) : array
return array