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

ActiveLibrary

xuanyan/router
==============

138PHP

Since Aug 11Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e523661e83c86fa56a7b2d01184194581e8e8c500e7d8d1d047a57f3f086ad5b/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7875616e79616e2f526f757465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/xuanyan/Router)

### How to use it

[](#how-to-use-it)

```
require_once __DIR__ . '/src/Router.php';

use XuanYan\Router as Router;

$router = new Router(__DIR__ . '/Controllers');

// set blog module
// handle url like: http://example.com/blog/controller/action, it was a rewrite url

$router->setModule('blog', __DIR__ . '/Blog/Controllers');

// map blog/xuanyan  to blogdb/xuanyan
$router->map('blog/:username', 'blogdb/:username');
// if u just want to handler the number you could use :NUM
$router->map('user/:NUM/profile', 'user/profile/:NUM');

// run router
// handle url like: http://example.com/?url=controller/action
// sure, u can use rewrite to let the url seems better
$router->run(@$_GET['url']);
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eb3f37500c8f11732193257a74160d77428ef03d260d0d84a5471f25fabf41f?d=identicon)[xuanyan](/maintainers/xuanyan)

---

Top Contributors

[![xuanyan](https://avatars.githubusercontent.com/u/25290?v=4)](https://github.com/xuanyan "xuanyan (32 commits)")

### Embed Badge

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

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

PHPackages © 2026

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