SimpleRoutesSet
Trait SimpleRoutesSet
Tags
Table of Contents
- dumpOnDisk() : void
- Method dumps all routes and their names on disk
- loadFromDisk() : void
- Method loads routes from disk
- addParamRoute() : void
- Method adds param router
- getAllRoutesTrace() : string
- Method rturns all available routes
- paramRouteExists() : bool
- Method returns true if the param router exists
Methods
dumpOnDisk()
Method dumps all routes and their names on disk
public
dumpOnDisk([string $filePath = './cache/cache.php' ]) : void
Parameters
- $filePath : string = './cache/cache.php'
-
file path to cache
Tags
Return values
void —loadFromDisk()
Method loads routes from disk
public
loadFromDisk([string $filePath = './cache/cache.php' ]) : void
Parameters
- $filePath : string = './cache/cache.php'
-
file path to cache
Tags
Return values
void —addParamRoute()
Method adds param router
protected
addParamRoute(string $requestMethod, string $route, mixed $callback) : void
Parameters
- $requestMethod : string
-
request method
- $route : string
-
route
- $callback : mixed
Return values
void —getAllRoutesTrace()
Method rturns all available routes
protected
getAllRoutesTrace() : string
Tags
Return values
string —trace
paramRouteExists()
Method returns true if the param router exists
protected
paramRouteExists(string $route, string $requestMethod) : bool
Parameters
- $route : string
-
checking route
- $requestMethod : string
-
HTTP request method
Tags
Return values
bool —true if the param router exists, false otherwise