PHPackages                             nickstuer/easy-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. [Framework](/categories/framework)
4. /
5. nickstuer/easy-router

ActiveLibrary[Framework](/categories/framework)

nickstuer/easy-router
=====================

A basic and easy to use router for PHP.

v0.0.1(10y ago)066MITPHPPHP &gt;=5.5.5

Since Dec 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/nickstuer/EasyRouter)[ Packagist](https://packagist.org/packages/nickstuer/easy-router)[ Docs](https://github.com/nickstuer/EasyRouter)[ RSS](/packages/nickstuer-easy-router/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

EasyRouter
==========

[](#easyrouter)

Introduction
------------

[](#introduction)

THIS PROJECT IS NOT BEING MAINTAINED AT THE MOMENT!

This is a basic PHP router mainly created for learning purposes. This works well for when you don't want the router function of your application tied tightly to the rest of your application.

Supports PHP 7+.

If you have any suggestions or bug fixes please feel free to do modify.

Example Usage
-------------

[](#example-usage)

Specify the controller and the controller method to call when a route is matched using addRoute().

To match wild cards use the following phrases in your route path:

- (any) - Matches any combination of upper case/lower case letters and numbers.
- (int) - Matches only integers.
- (abc) - Matches any combination of upper case/lower case letters.

#### Typical Use of Easy Router

[](#typical-use-of-easy-router)

```
include (__DIR__ . '/vendor/autoload.php');

use \NickStuer\EasyRouter\Route as Route;

$routeManager = new \NickStuer\EasyRouter\RouteManager();
$dispatcher = new \NickStuer\EasyRouter\Dispatcher($routeManager);

$routeManager->addRoute(new Route('get', '/', 'ControllerToCall@methodToCall'));
$routeManager->addRoute(new Route('get', '/about', 'PagesController@showAbout'));
$routeManager->addRoute(new Route('get', '/contact', 'PagesController@showContact'));
$routeManager->addRoute(new Route('get', '/profile/(abc)', 'ProfileController@showProfile'));

try {
    $dispatcher->dispatch();
} catch (\NickStuer\EasyRouter\Exceptions\RouteNotFoundException $e) {
    echo "Route Not Found - 404";
    exit;
} catch (\NickStuer\EasyRouter\Exceptions\MethodNotAllowedException $e) {
    echo "Method Not Allowed - 405";
    exit;
}

$routeInfo = $dispatcher->getMatchedRoute();

/**
 * It's recommended that you use a DI container to create the controller class to
 * automatically insert the required dependencies.
 */
$controller = new $routeInfo['controller'];
$method = $routeInfo['method'];
$controller->$method($routeInfo['variables']);
```

License
-------

[](#license)

Easy Router is licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3856d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13244693?v=4)[Nick Stuer](/maintainers/nickstuer)[@nickstuer](https://github.com/nickstuer)

---

Top Contributors

[![nickstuer](https://avatars.githubusercontent.com/u/13244693?v=4)](https://github.com/nickstuer "nickstuer (71 commits)")

---

Tags

routerroute

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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.

675224.9k18](/packages/pecee-simple-router)[izniburak/router

simple router class for php

23323.2k7](/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.5k](/packages/developermarius-simple-router)

PHPackages © 2026

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