Class Router
Implements routing functionality based on a URI.
Usage
\Sleepy\Router::route('/user/{{ id }}/*', function ($route) { echo "The route uses the pattern: ", $route->pattern; echo "Route was matched using method: ", $route->method; echo "The wildcard matched: ", $route->splat; echo "Showing user ", $route->params['id'], "</br>"; });
Changelog
Version 1.1
- updated private prefix (_) for consistency
- updated documentation
Version 1.0
- With unit tests in place, we're ready to call this 1.0
Version 0.4
- Simplified interface, thanks @cameff
Namespace: Sleepy
License: http://opensource.org/licenses/MIT
Author: Jaime A. Rodriguez hi.i.am.jaime@gmail.com
Version: 1.1
Todo: Document the class and add it to homepage
Date: July 18, 2016
Located at class.router.php
License: http://opensource.org/licenses/MIT
Author: Jaime A. Rodriguez hi.i.am.jaime@gmail.com
Version: 1.1
Todo: Document the class and add it to homepage
Date: July 18, 2016
Located at class.router.php
public static
array
|
|
public static
object
|
|
public static
object
|
|
public static
object
|
|
public static
boolean
|
|
public static
|
private static
array
|
$_routes
An array of routes |
#
array()
|
public static
boolean
|
$routeFound
Has a route been matched? |
#
false
|
public static
string
|
$delimiter
The delimiter for the route pattern |
#
'/'
|
public static
boolean
|
$querystring
If true, parse the querystring instead of the path |
#
false
|
public static
array
|
$parameters
An array of parameters, either from the path or querystring |
#
array()
|