duyler/router

Duyler router

dev-main 2024-03-13 06:08 UTC

This package is auto-updated.

Last update: 2024-05-13 06:41:07 UTC


README

build

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]);