CommonPHP Router provides route definition and matching support for CommonPHP applications. It maps HTTP requests to actions, surfaces, or handlers using clear route definitions and CommonPHP conventions.
The package keeps routing explicit while remaining separate from request/response mechanics and application rendering.
- PHP
^8.5 comphp/runtime:^0.3
Once this package is available through your Composer repositories, install it with:
composer require comphp/router<?php
// TODO: Write usageThis package should define and match routes, route groups, constraints, and dispatch metadata. HTTP request handling belongs in comphp/http, and action execution belongs in the relevant action/web/API package.
Invalid route definitions, duplicate routes, unmatched routes, and dispatch failures should throw CommonPHP router exceptions or return route-not-found results as appropriate.
MIT. See LICENSE.md.