duyler / router
Duyler router
dev-main
2024-03-13 06:08 UTC
Requires
- php: ^8.3
- psr/http-message: ^1.1|^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.51
- phpunit/phpunit: ^10.0
README
Usage routing:
Route::get('/categories/edit/{$id}') ->where(['id' => Type::Integer]) ->handler('Catalog') ->action('CategoryEdit') ->name('category.edit'); $routeCollection = new RouteCollection(); $routeCollection->add( Route::get('/categories/edit/{$id}') ->where(['id' => Type::Integer]) ->handler('Catalog') ->action('CategoryEdit') ->name('category.edit') ); $router = new Router(); $currentRoute = $router->startRouting($routeCollection, $request);
Creating links from routes:
Url::get('category.edit', ['id' => 1]);