PHPackages                             jasny/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jasny/router

Abandoned → [jasny/switch-route](/?search=jasny%2Fswitch-route)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

jasny/router
============

A versatile router for PHP

v1.1.3(6y ago)19.2k↓33.3%21MITPHPPHP &gt;=5.6.0

Since Oct 11Pushed 6y agoCompare

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

READMEChangelog (7)Dependencies (4)Versions (23)Used By (1)

Jasny Router
============

[](#jasny-router)

[![Build Status](https://camo.githubusercontent.com/3b21bc412e27fa7b48eb2f4e9456165bc545ecec69680ef76b5b65c572c6eeeb/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6a61736e792f726f757465722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/jasny/router)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ae65f2fbb55d6d7cdc042567ccaa63ef2b6844f09b008113d8e5409f930f5f7b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a61736e792f726f757465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jasny/router/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/69fbe71c515d4f209878d9c4427821667593ee863cf41f0fc9ba094df75a619b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a61736e792f726f757465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jasny/router/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/d2c4bab0afaf77583442c3f26f3cbc4a08a2f99c7816cbdf2b4bc482268b9bc3/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32386161646536312d653134662d343533322d626261322d3531343663663361326236372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/28aade61-e14f-4532-bba2-5146cf3a2b67)[![Packagist Stable Version](https://camo.githubusercontent.com/e1bd45eeea01f8a11d6e41f6ba8843b1817fbd7d9474f4307b8f969a90f57ee2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a61736e792f726f757465722e737667)](https://packagist.org/packages/jasny/router)[![Packagist License](https://camo.githubusercontent.com/acad452248f32764b3c233aaddc6962094351389f3e66a681b88a6b171de5a1d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a61736e792f726f757465722e737667)](https://packagist.org/packages/jasny/router)

Jasny Router is a versatile PSR-7 compatible router. It decouples the way to determine a route, from the routing and from running the routed action. The router supports double pass middleware.

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

[](#installation)

The Jasny Router package is available on [packagist](https://packagist.org/packages/jasny/router). Install it using composer:

```
composer require jasny/router

```

Basic Usage
-----------

[](#basic-usage)

```
use Jasny\Router;
use Jasny\Router\Routes\Glob as Routes;
use Jasny\HttpMessage\ServerRequest;
use Jasny\HttpMessage\Response;

$routes = new Routes([
    '/' => function($request, $response) {
        $response->getBody()->write('Hello world');
        return $response;
    },
]);

$router = new Router($routes);
$router->handle(new ServerRequest()->withGlobalEnvironment(), new Response());
```

Routes
------

[](#routes)

When creating a `Router`, you need to pass a object that implements the `RoutesInterface`. Routes should be seen as a collection of routes, with the ability to select one of those routes based on the server request.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 89.6% 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 ~129 days

Recently: every ~284 days

Total

10

Last Release

2314d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3379a93d51305df325df9045e1a8b205d195e4e8c01312dff53a000ee79002eb?d=identicon)[jasny](/maintainers/jasny)

---

Top Contributors

[![jasny](https://avatars.githubusercontent.com/u/100821?v=4)](https://github.com/jasny "jasny (164 commits)")[![Minstel](https://avatars.githubusercontent.com/u/6154708?v=4)](https://github.com/Minstel "Minstel (17 commits)")[![moesjarraf](https://avatars.githubusercontent.com/u/5793511?v=4)](https://github.com/moesjarraf "moesjarraf (1 commits)")[![zltn](https://avatars.githubusercontent.com/u/1194401?v=4)](https://github.com/zltn "zltn (1 commits)")

---

Tags

routerroutingmvc

### Embed Badge

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

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

###  Alternatives

[bramus/router

A lightweight and simple object oriented PHP Router

1.1k458.8k49](/packages/bramus-router)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[vectorface/snappy-router

A quick and snappy routing framework.

4614.7k](/packages/vectorface-snappy-router)

PHPackages © 2026

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