conia/route

PSR-7/PSR-15 router and dispatcher

dev-main 2024-01-28 11:08 UTC

This package is auto-updated.

Last update: 2024-12-17 17:41:19 UTC


README

A PSR-7 compatible router and view dispatcher.

<?php
$router = new Router();
$router->get('/{name}', funtion (string $name) { return "<h1>{$name}</h1>"; });
$request = new ServerRequest();
$route = $router->match($request);
$dispatcher = new Dispatcher();
$response = $dispatcher->dispatch($request, $route);