comphp/router

Route definition, matching, and dispatch support for PHP applications.

Maintainers

Package info

github.com/commonphp/router

pkg:composer/comphp/router

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

0.3 2026-05-17 22:55 UTC

This package is auto-updated.

Last update: 2026-05-17 22:56:11 UTC


README

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.

Requirements

  • PHP ^8.5
  • comphp/runtime:^0.3

Installation

Once this package is available through your Composer repositories, install it with:

composer require comphp/router

Usage

<?php

// TODO: Write usage

Package Notes

This 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.

Error Handling

Invalid route definitions, duplicate routes, unmatched routes, and dispatch failures should throw CommonPHP router exceptions or return route-not-found results as appropriate.

Documentation

License

MIT. See LICENSE.md.