PHPackages                             opine/route - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. opine/route

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

opine/route
===========

Service wrapper for FastRoute providing a more slim-like interface

3.0.20(9y ago)6674113MITPHPPHP &gt;=7.0.0

Since Nov 23Pushed 9y ago4 watchersCompare

[ Source](https://github.com/Opine-Org/Route)[ Packagist](https://packagist.org/packages/opine/route)[ RSS](/packages/opine-route/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (13)

Opine\\Route
============

[](#opineroute)

Service wrapper for FastRoute providing a more slim-like interface.

[![Stories in Ready](https://camo.githubusercontent.com/562436d86ba6cea45e0bc5402a83db4f43446ef74b4624a91b4be052ef48b03a/68747470733a2f2f62616467652e776166666c652e696f2f4f70696e652d4f72672f526f7574652e706e673f6c6162656c3d7265616479267469746c653d5265616479)](https://waffle.io/Opine-Org/Route)

[![Build Status](https://camo.githubusercontent.com/aa637ae51e759fe38374e532871309d6ebe02d74fbbe38ae11931a8ec52271cb/68747470733a2f2f7472617669732d63692e6f72672f4f70696e652d4f72672f526f7574652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Opine-Org/Route)

[![Scrutinizer Quality Score](https://camo.githubusercontent.com/6a57efcdb47a2426c7f49f4c864f9ed26c97665ab3c8689612eeb3ea81a4be1e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f70696e652d4f72672f526f7574652f6261646765732f7175616c6974792d73636f72652e706e673f733d33343539363063393631633664366461393738386434323338633266396332613930613239613834)](https://scrutinizer-ci.com/g/Opine-Org/Route/)

[![Code Coverage](https://camo.githubusercontent.com/2a69ad5410d52909d26832a6538ea97cb703abad7f58ec053329484b56c2aaf9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f70696e652d4f72672f526f7574652f6261646765732f636f7665726167652e706e673f733d61386262356339666437623938633763346465626234643838653130363465653565343866336334)](https://scrutinizer-ci.com/g/Opine-Org/Route/)

Background
----------

[](#background)

[FastRoute](https://github.com/nikic/FastRoute) is an extremely fast PHP routing library.

Opine\\Route is a service wrapper that makes it easy to define routes via a YAML file, cache routes and execute them.

Route Sample
------------

[](#route-sample)

```
route:
    GET:
        /sample:                            controller@sampleOutput
        /api/add:                           controller@sampleOutput
        /api/edit:                          controller@sampleOutput
        /api/list:                          controller@sampleOutput
        /api/upload:                        controller@sampleOutput
        /api/upload/file:                   controller@sampleOutput
        /api/upload/file/{name}:            controller@sampleOutput2
        /api2/add:                          [controller@sampleOutput, {before: controller@beforeFilter, after: controller@afterFilter}]
        /api2/edit:                         [controller@sampleOutput, {before: controller@beforeFilter, after: controller@afterFilter}]
        /api2/list:                         [controller@sampleOutput, {before: controller@beforeFilter, after: controller@afterFilter}]
        /api2/upload:                       [controller@sampleOutput, {before: controller@beforeFilter, after: controller@afterFilter}]
        /api2/upload/file:                  [controller@sampleOutput, {before: controller@beforeFilter, after: controller@afterFilter}]
        /api2/upload/file/{name}:           [controller@sampleOutput2, {before: controller@beforeFilter, after: controller@afterFilter}]
        /sample2:                           [controller@sampleOutput, {name: Sample}]
        /sample3/{name}:                    [controller@sampleOutput2, {name: SampleParam}]
        /sample3/{name}/{age}/{location}:   [controller@sampleOutput3, {name: SampleParamAssoc}]
        /redirect:                          controller@sampleRedirect
```

Load / Execute Routes
---------------------

[](#load--execute-routes)

```
$routeFile = '/var/www/project/config/routes/route.yml';
$containerFile = '/var/www/project/config/containers/container.yml';
$webroot = '/var/www/project/public';
$config = new \Opine\Config\Service($webroot);
$config->cacheSet();
$container = \Opine\Container\Service::instance($webroot, $config, $containerFile);
$routeService = new Opine\Route\Service($webroot, $container);
$routeModel = new Opine\Route\Model($webroot, $routeService);
$routeModel->yaml($routeFile);
$response = $this->route->run('GET', '/sample');
var_dump($response);
```

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

[](#installation)

```
composer require "opine/route:dev-master"
composer install
```

Author
------

[](#author)

Ryan Mahoney can be reached at  or @vcryan on Twitter.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 69.9% 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 ~51 days

Recently: every ~8 days

Total

15

Last Release

3439d ago

PHP version history (2 changes)3.0.3PHP &gt;=5.5.0

3.0.11PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c44f040dad14ac398dcc450aac4a37b1bed4378e936ef637c0454fc946ee0662?d=identicon)[virtuecenter](/maintainers/virtuecenter)

---

Top Contributors

[![ryan-mahoney](https://avatars.githubusercontent.com/u/988609?v=4)](https://github.com/ryan-mahoney "ryan-mahoney (65 commits)")[![rmahoney-bsd](https://avatars.githubusercontent.com/u/6912313?v=4)](https://github.com/rmahoney-bsd "rmahoney-bsd (14 commits)")[![rmahoney-bl](https://avatars.githubusercontent.com/u/10089703?v=4)](https://github.com/rmahoney-bl "rmahoney-bl (13 commits)")[![waffle-iron](https://avatars.githubusercontent.com/u/6912981?v=4)](https://github.com/waffle-iron "waffle-iron (1 commits)")

---

Tags

fastroutephprouteryamlroutingFastRouteOpine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/opine-route/health.svg)

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

###  Alternatives

[middlewares/fast-route

Middleware to use FastRoute

96191.1k15](/packages/middlewares-fast-route)[mezzio/mezzio-fastroute

FastRoute integration for Mezzio

162.7M52](/packages/mezzio-mezzio-fastroute)[yiisoft/router-fastroute

Yii router FastRoute adapter

41301.0k14](/packages/yiisoft-router-fastroute)[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)
