PHPackages                             opdss/nroute - 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. opdss/nroute

ActiveLibrary[Framework](/categories/framework)

opdss/nroute
============

a slim plugin

v1.0.0(7y ago)1541MITPHPPHP &gt;=5.5.0

Since Jan 31Pushed 7y ago2 watchersCompare

[ Source](https://github.com/opdss/Nroute)[ Packagist](https://packagist.org/packages/opdss/nroute)[ Docs](http://php.istimer.com)[ RSS](/packages/opdss-nroute/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (1)Versions (8)Used By (0)

Nroute
======

[](#nroute)

slim框架的注释路由器

适用于psr4规范的 控制器-&gt;方法 类型路由

如我的控制器目录是 APP\_DIR . 'Controllers'， 其命名空间是 App\\Controllers， 结构如下

- APP\_DIR
    - Controllers
        - User.php
        - Article.php

User.php 内容如下：

```
namespace App\Controllers;

use App\Models\Users;
use Slim\Http\Request;
use Slim\Http\Response;

class User
{
	/**
	 * 首页
	 *
	 * @pattern /users
	 * @method get
	 * @middleware \App\Middleware\Auth
	 * @param Request $request
	 * @param Response $response
	 * @param array $args
	 * @return Response
	 */
	public function index(Request $request, Response $response, array $args)
	{
	    return Users::all();
	}
}

```

然后在index.php 加入如下代码：

```
$config = array('cacheDir'=>CACHE_DIR, 'forceUseCache'=> true);
\Opdss\Nroute\Nroute::factory($config)->register($app, array(APP_DIR . 'Controllers' => 'App\\Controllers'));

```

/users 路由就会自动读取注册了

forceUseCache参数

forceUseCache参数可以加速路由注册执行的速度，略去了繁琐的文档扫描。 但是当使用了forceUseCache参数的时候，注册器会检测是否有缓存，有则直接读取，将不再判断扫描是否有更新。 所以生产环境使用了这个参数的时候，需要更新路由时可以使用forceUpdate() 方法强制扫描刷新路由缓存。

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

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 ~37 days

Recently: every ~55 days

Total

7

Last Release

2803d ago

Major Versions

v0.3.0 → v1.0.02018-09-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e6bff6633fe4a2a44b301b0b42b5d8530262fd0ecacafe2cd6618c59bea6765?d=identicon)[opdss](/maintainers/opdss)

---

Top Contributors

[![opdss](https://avatars.githubusercontent.com/u/11657233?v=4)](https://github.com/opdss "opdss (15 commits)")

---

Tags

routerslimroute

### Embed Badge

![Health badge](/badges/opdss-nroute/health.svg)

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

###  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)[ecoal95/php-router

Minimal routing library

271.0k1](/packages/ecoal95-php-router)[rosengate/exedra

Nestful route oriented PHP micro framework

142.0k1](/packages/rosengate-exedra)[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)
