PHPackages                             softwarepunt/minirouter - 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. softwarepunt/minirouter

ActiveLibrary

softwarepunt/minirouter
=======================

Fast and lightweight PSR-7 request router for PHP

v0.4.1(7mo ago)135MITPHPPHP &gt;=8.4CI passing

Since Jan 1Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/SoftwarePunt/minirouter)[ Packagist](https://packagist.org/packages/softwarepunt/minirouter)[ RSS](/packages/softwarepunt-minirouter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

MiniRouter
==========

[](#minirouter)

[![PHPUnit](https://github.com/SoftwarePunt/minirouter/actions/workflows/php.yml/badge.svg)](https://github.com/SoftwarePunt/minirouter/actions/workflows/php.yml)

**A fast and lightweight router for PHP, compatible with [PSR-7](https://www.php-fig.org/psr/psr-7/):**

- ⏩ Super fast request-response routing
- 🌟 Static or dynamic routes with unlimited URL variables
- 💉 Automatic parameter injection for requests and route variables

Installation
------------

[](#installation)

Install the package using [Composer](https://getcomposer.org/):

```
composer require softwarepunt/minirouter
```

This package is compatible with PHP 8.4+.

Usage
-----

[](#usage)

### Registering routes

[](#registering-routes)

Initialize a new instance of `MiniRouter` and start registering routes:

```
