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

ActiveLibrary

super-simple/router
===================

Super Simple PHP Routing library.

v1.1(3y ago)05MITPHPPHP &gt;=8.1

Since Jul 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/alextodorov/super-simple-router)[ Packagist](https://packagist.org/packages/super-simple/router)[ RSS](/packages/super-simple-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Super Simple Router
===================

[](#super-simple-router)

PHP router library

[![Build Status](https://github.com/alextodorov/super-simple-router/actions/workflows/phpunit.yml/badge.svg?branch=main)](https://github.com/alextodorov/super-simple-router/actions/workflows/phpunit.yml/badge.svg?branch=main)

Install
-------

[](#install)

```
composer require super-simple/router
```

Requires PHP 8.1 or newer.

Usage
-----

[](#usage)

Basic usage:

```
// Create a router.
$router = new Router;

// Add a route
$router->addRoute(
    '/test', // uri
    HTTPMethod::from($httpMethod), // http method
    function () {return 'success';} // handler in this case is callable
);

// Or add a route as array

$router->addRoute(
    '/test', // uri
    HTTPMethod::from($httpMethod), // http method
    [
        'controller' => SomeController::class,
        'action' => 'index',
    ] // handler in this case array with config
);

// Or create a config and add routes using config. The config requires keys: uri,method,handler
// It depends on developer how to construct the handler array.
$config = [
    'uri' => '/just-a-test-route',
    'method' => 'GET',
    'handler' => [
        'controller' => SomeController::class,
        'action' => 'index',
    ],
];

$router->addConfig($config);

......

// Parse upcoming request

$result = $router->parse($uri, HTTPMethod::from($httpMethod)); // $uri and $httpMethod must come from Request.
```

The result of parsing is an array.

The first element is the uri.

The second element is handler.

The third element contains the params if any exist.

```
$result[0]; // is the uri.

// if the handler is callable you can call it like:
$result[1]();

// or with params

$result[1](...$result[2]);

// when using handler array instead of callable:
// It depends on structure of handler array.
// In this example we have two keys the controller and the action.
(new $result[1]['controller'])->{$result[1]['action']}();

// Or with params
(new $result[1]['controller'])->{$result[1]['action']}(...$result[2]);
```

You can expect some exceptions:

```
SSRouter\\NotFound // when router is not found
\ValueError // when method not found in HTTPMethod enum
\TypeError // comes from HTTPMethod enum or when the config array is not build correctly.

// Simple use
try {
    //.......
} catch {} // to handle these errors.
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Every ~0 days

Total

2

Last Release

1394d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/37d077d15593526771b4449e95672fdbee0bc370378d639ecd7bf8dc2b7e5a5a?d=identicon)[kriviabg](/maintainers/kriviabg)

---

Top Contributors

[![alextodorov](https://avatars.githubusercontent.com/u/11376556?v=4)](https://github.com/alextodorov "alextodorov (14 commits)")

---

Tags

routerroutingroute

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aura/router

Powerful, flexible web routing for PSR-7 requests.

5231.5M67](/packages/aura-router)[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)[pmjones/auto-route

Automatically routes HTTP request to action classes.

20158.6k6](/packages/pmjones-auto-route)[miladrahimi/phprouter

A powerful, lightweight, and very fast HTTP URL router for PHP projects.

20832.6k2](/packages/miladrahimi-phprouter)[izniburak/router

simple router class for php

23522.6k7](/packages/izniburak-router)[contributte/api-router

RESTful Router for your Apis in Nette Framework - created either directly or via attributes

20802.8k3](/packages/contributte-api-router)

PHPackages © 2026

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