PHPackages                             strident/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. strident/router

ActiveLibrary

strident/router
===============

Routing component designed for ease of use and speed. Built for Trident.

2.0.1(11y ago)115MITPHPPHP &gt;=5.4

Since Feb 10Pushed 11y ago2 watchersCompare

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

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

\#Router [![Build Status](https://camo.githubusercontent.com/f0b87a72ff902b86576e41f2e49fc31fbba95c4ba0d7a23667d8aca514b5e59c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5374726964656e742f526f757465722e737667)](https://travis-ci.org/Strident/Router)[![Coverage](https://camo.githubusercontent.com/6dbde9bd1347520a32fa5d44d58df3d9cb15149810cc036185690ba2f0981794/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f6769746875622f5374726964656e742f526f757465722e737667)](https://codeclimate.com/github/Strident/Router)[![Code Climate](https://camo.githubusercontent.com/f4f8ec5ba3be70bc85d31866aece4a1a2b73bf5e79e484cea0d13435c8bbfd81/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f5374726964656e742f526f757465722e737667)](https://codeclimate.com/github/Strident/Router)

Routing component designed for ease of use and speed. Built for Trident.

\##Installation

Installation is available via Composer. Add the package to your `composer.json`:

```
$ composer require strident/router ~2.0

```

\##Usage

The Strident Router package is flexible and allows you to swap out components to extend it easier. To create a `Router`, do the following:

```
use Strident\Router\RouteFactory;
use Strident\Router\RouteMatcher;
use Strident\Router\Router;

$factory = new RouteFactory();
$matcher = new RouteMatcher();
$router  = new Router($factory, $matcher);
```

From there, you can define routes like so:

```
$router->route("route_name", "/route/path/{parameter}/{placeholders}")
    ->target("GET", "FooController::getAction")
    ->target("POST", "FooController::postAction")
;
```

The `route()` method of the `Router` returns the instance of a the created `Route`. The `Route` can then define it's targets for specific HTTP methods by using the `target()` method.

To dispatch the current request in the `Router`, use the `dispatch()` method of the `Router`.

```
$matched = $router->dispatch("GET", "/route/path/1/2");
```

The return value of `dispatch()` is an array containing information about the matched route. This includes the name of the route, the request method, the path, and the parameters (by name, and index).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Every ~2 days

Total

6

Last Release

4103d ago

Major Versions

1.0.3 → 2.0.02015-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/78b157e833b14bfc790633c9f715d1c433cefbaff4987199a33d6319ceb5a28e?d=identicon)[Seer](/maintainers/Seer)

---

Top Contributors

[![seeruk](https://avatars.githubusercontent.com/u/2083033?v=4)](https://github.com/seeruk "seeruk (36 commits)")

---

Tags

routercomponenttrident

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/routing

Maps an HTTP request to a set of configuration variables

7.6k789.4M1.8k](/packages/symfony-routing)[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.3k49.9M1.3k](/packages/slim-slim)[nikic/fast-route

Fast request router for PHP

5.3k92.4M668](/packages/nikic-fast-route)

PHPackages © 2026

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