PHPackages                             level-2/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. [API Development](/categories/api)
4. /
5. level-2/router

ActiveLibrary[API Development](/categories/api)

level-2/router
==============

4246[1 issues](https://github.com/Level-2/Router/issues)PHP

Since Feb 13Pushed 7y ago4 watchersCompare

[ Source](https://github.com/Level-2/Router)[ Packagist](https://packagist.org/packages/level-2/router)[ RSS](/packages/level-2-router/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Router
======

[](#router)

Router for the level 2 framework. This is an extensible router, the router does not provide any routing rules and needs to be extended with rules that use the `Level2\Router\Rule` interface.

Usage
-----

[](#usage)

Create an instance of the router and load any rules into it

```
//Create an instance of a class that implements \Level2\Router\Rule
$rule = new Rule;

$router = new \Level2\Router\Router;
$router->addRule($rule);

$url = $_SERVER['REQUEST_URI']

$route = $router->find(explode('/', $url))
```

The router will return a `Route` object that has methods for returning the matched model, view and controller. It is up to the loaded rule to create this instance.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5889315?v=4)[TomButler](/maintainers/TomButler)[@tombutler](https://github.com/tombutler)

---

Top Contributors

[![TRPB](https://avatars.githubusercontent.com/u/2454540?v=4)](https://github.com/TRPB "TRPB (6 commits)")[![solleer](https://avatars.githubusercontent.com/u/16144751?v=4)](https://github.com/solleer "solleer (1 commits)")

### Embed Badge

![Health badge](/badges/level-2-router/health.svg)

```
[![Health](https://phpackages.com/badges/level-2-router/health.svg)](https://phpackages.com/packages/level-2-router)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
