Router
class Router extends AltoRouter
Properties
| protected array | $routes | from AltoRouter | |
| protected array | $namedRoutes | from AltoRouter | |
| protected string | $basePath | from AltoRouter | |
| protected array | $matchTypes | from AltoRouter |
Methods
Create router in one call from config.
Add multiple routes at once from array in the following format:
Add named match types. It uses array_merge so keys can be overwritten.
Map a route to a target
Match a given Request Url against stored routes
No description
No description
Details
at line 20
__construct($sysconf, $obj_db)
Create router in one call from config.
in
AltoRouter at line 50
array
getRoutes()
Retrieves all routes.
Useful if you want to process or display routes.
in
AltoRouter at line 66
void
addRoutes(array $routes)
Add multiple routes at once from array in the following format:
$routes = array( array($method, $route, $target, $name) );
in
AltoRouter at line 79
setBasePath($basePath)
Set the base path.
Useful if you are running your application from a subdirectory.
in
AltoRouter at line 88
addMatchTypes(array $matchTypes)
Add named match types. It uses array_merge so keys can be overwritten.
in
AltoRouter at line 101
map(string $method, string $route, mixed $target, string $name = null)
Map a route to a target
in
AltoRouter at line 127
string
generate(string $routeName, array $params = array())
Reversed routing
Generate the URL for a named route. Replace regexes with supplied parameters
at line 27
array|bool
match(string $requestUrl = null, string $requestMethod = null)
Match a given Request Url against stored routes
in
AltoRouter at line 243
protected
compileRoute($route)
Compile the regex for a given route (EXPENSIVE)
at line 100
makeCallable($string)
No description
at line 112
run()
No description