duyler/router

Duyler router

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

This package is auto-updated.

Last update: 2024-12-13 07:52:04 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]);