Download the PHP package oihana/php-routes without Composer
On this page you can find all versions of the php package oihana/php-routes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-routes
Oihana PHP - Routes

Declarative, composable HTTP route definitions for PHP 8.4+, built on Slim.
π Documentation
User guides (FR + EN), with narrative explanations and examples:
| π¬π§ English documentation | π«π· Documentation franΓ§aise |
|---|---|
| Getting started, routes, HTTP method routes, document & i18n routes, helpers, testing. | DΓ©marrage, routes, routes par mΓ©thode HTTP, routes document & i18n, helpers, tests. |
Auto-generated API reference (phpDocumentor):
π https://bcommebois.github.io/oihana-php-routes
π§ What is it?
oihana/php-routes provides a small, declarative layer for defining HTTP routes
on top of Slim: a composable Route base, one class per HTTP verb
(GetRoute, PostRoute, β¦), higher-level DocumentRoute / I18nRoute, and
helpers to register them on a Slim app from a PSR-11 container. Each route maps
a URL pattern to a controller method.
For full details (route classes, flags, helpers), see the table of contents in the documentation.
π Features
- π§ A composable
Routebase and per-verb route classes βGetRoute,PostRoute,PutRoute,PatchRoute,DeleteRoute,DeleteAllRoute,OptionsRoute,ListRoute. - π Higher-level routes β
DocumentRouteandI18nRoutefor documents and localized paths. - π© Declarative route options via the
RouteFlagbit flags. - π§© Route registration helpers β
HttpMethodRoutesTrait,HasRouteTrait, pluswithPlaceholder()andresponsePassthrough(). - π Built on Slim and wired through a PSR-11 container.
- π§ͺ Full unit-test coverage ensuring reliability and maintainability.
π‘ Designed to be composable, testable, and compatible with any PHP 8.4+ project.
π¦ Installation
Requires PHP 8.4+
Install via Composer:
oihana/php-routesdepends onoihana/php-controllers, which requires theext-imagickextension β make sure it is installed.
β Tests & coverage
Run the full unit-test suite (PHPUnit, strict mode):
Run a single test case:
Measure coverage (requires Xdebug or PCOV):
The suite runs in strict mode and targets 100% line coverage.
π§Ύ License
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0).
π€ About the author
- Author : Marc ALCARAZ (aka eKameleon)
- Mail : [email protected]
- Website : http://www.ooop.fr
π οΈ Generate the Documentation
We use phpDocumentor to generate the documentation into the ./docs folder.
Usage
Run the command :
π Related packages
- oihana/php-controllers β the HTTP controllers the routes dispatch to (provides
AppTrait). - oihana/php-core β core helpers and utilities used by this library.
- oihana/php-enums β strongly-typed constant enumerations (HTTP methods, etc.).
All versions of php-routes with dependencies
oihana/php-core Version dev-main
oihana/php-controllers Version dev-main
oihana/php-enums Version dev-main
oihana/php-logging Version dev-main
oihana/php-reflect Version dev-main
oihana/php-traits Version dev-main
php-di/php-di Version ^7.0
psr/container Version ^2.0
psr/http-message Version ^1.1 || ^2.0