PHPackages                             darktec/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. [Framework](/categories/framework)
4. /
5. darktec/router

ActiveLibrary[Framework](/categories/framework)

darktec/router
==============

Routing package for PHP 8

1.0.0-alpha.1(1y ago)2141[1 issues](https://github.com/dark-php/router/issues)1MITPHPPHP &gt;=8.0

Since Oct 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dark-php/router)[ Packagist](https://packagist.org/packages/darktec/router)[ Docs](https://github.com/dark-php/router)[ RSS](/packages/darktec-router/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

PHP7 Routing Package
====================

[](#php7-routing-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cc70c18c678ecd96ba5bb2b9fdd3b60f255c97134ed8766b5f5450dffc94539e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461726b7465632f726f757465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/darktec/router)[![Software License](https://camo.githubusercontent.com/f13aa5bd22f6a24c17d731e0e331d26e949821be4b836f8897284224952cc5e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6461726b7465632f726f757465722e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/88877caf37848504e9bda43912eaa292f4526816c97c8e13cf326fb592a6beb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461726b7465632f726f757465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/darktec/router)

Install
-------

[](#install)

To install router as a Composer package run:

```
$ composer require darktec/router
```

Usage
-----

[](#usage)

First initialize the router

```
Router::init();
```

Then create your mappings using METHOD, ROUTE, ACTION where ACTION is a function

```
Router::map('GET', '/', '\package\controller@function');

// OR

Router::map('GET', '/', function() {
    echo 1;
});
```

Finally match the request method and URI

```
Router::match($method, $uri);
```

If a match is found then the function defined is invoked.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Credits
-------

[](#credits)

- [DarkTec](https://github.com/dark-php)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

572d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ffce6d5181954e2fb00aa91e9546bd39efc60cb416412beee84dfd3929faa9e?d=identicon)[Darkmantle](/maintainers/Darkmantle)

---

Top Contributors

[![darkmantle](https://avatars.githubusercontent.com/u/410651?v=4)](https://github.com/darkmantle "darkmantle (20 commits)")

---

Tags

routerroutingroutephp8

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[pecee/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

696214.6k17](/packages/pecee-simple-router)[izniburak/router

simple router class for php

23522.6k7](/packages/izniburak-router)[heropoo/routing

A simple and fast route. Use tree structure storage, fast matching!

115.6k1](/packages/heropoo-routing)[ecoal95/php-router

Minimal routing library

271.0k1](/packages/ecoal95-php-router)[developermarius/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

112.4k](/packages/developermarius-simple-router)

PHPackages © 2026

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