use Fratily\Router\RouterBuilder;
use Fratily\Router\Route;
use Fratily\Router\RouteOption;
$option = new RouteOption();
$routes = [
new Route('/', $option->strictCheckTrailing(false)),
new Route('/foo/bar', $option->strictCheckTrailing(false)),
new Route('/foo/:name'),
$matchRoute = (new Route('/foo/:name/setting')),
new Route('/foo/:name/profile'),
new Route('/bar'),
new Route('/baz'),
];
$router = (new RouterBuilder($routes))->build();
[
'route' => $route, // $matchRoute
'params' => $params // ['name' => 'any']
] = $router->match('/foo/any/setting');
-
Notifications
You must be signed in to change notification settings - Fork 0
License
fratily/router
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published