PHPackages                             wilaak/radix-router - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. wilaak/radix-router

ActiveLibrary[HTTP &amp; Networking](/categories/http)

wilaak/radix-router
===================

High-performance radix tree based HTTP request router

v3.6.7(1mo ago)616.1k↑3907.7%2[2 issues](https://github.com/wilaak/radix-router/issues)4MITPHPPHP &gt;=8.0CI passing

Since Jul 12Pushed 2w agoCompare

[ Source](https://github.com/wilaak/radix-router)[ Packagist](https://packagist.org/packages/wilaak/radix-router)[ Docs](https://github.com/wilaak/radix-router)[ RSS](/packages/wilaak-radix-router/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (8)Versions (30)Used By (4)

[![RadixRouter](./assets/radx.svg)](./assets/radx.svg)
======================================================

[](#)

[![License](https://camo.githubusercontent.com/9320187555fc8804eba9ff702577334f29b1392b81ba4a8890827efcfa4b05a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f77696c61616b2f72616469782d726f757465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wilaak/radix-router)[![Downloads](https://camo.githubusercontent.com/d1c5fc55dc5756bd15dcce23131bf63de8ade78652446a742362b8650724f304/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77696c61616b2f72616469782d726f757465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wilaak/radix-router)

A very simple radix tree based HTTP router for PHP. Use it directly, or as a base for your own router (see [integrations](#integrations)).

- Path parameters: optional and wildcard (one per segment)
- API for listing routes/methods (useful for OPTIONS)
- Automatic 405 Method Not Allowed handling
- Zero dependencies and only 377 lines of code

See [benchmarks](#benchmarks) for how it compares to others.

Install
-------

[](#install)

```
composer require wilaak/radix-router
```

Requires PHP 8.0 or newer.

Usage
-----

[](#usage)

Below is an example to get you started using the PHP SAPI.

```
