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

ActiveLibrary[Framework](/categories/framework)

dez-php/dez-router
==================

Router Component

v1.3.1(9y ago)02943MITPHPPHP &gt;=5.5

Since Sep 27Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (9)Used By (3)

DezByte Router
==============

[](#dezbyte-router)

Initialization
--------------

[](#initialization)

After `composer install` register few components to DI

```
$di = new Container();

$di->set( 'router', function() {
  return new Router();
} );

$di->set( 'eventDispatcher', function() {
  new Dispatcher();
} );

$di->set( 'request', function() {
  return new Request();
} );

// try to fetch router from container
try {
  /** @var $router Router */
  $router = $di->get( 'router' );
} catch ( \Exception $e ) {
  die($e->getMessage());
}
```

Register routes
---------------

[](#register-routes)

```
$router->add( '/:controller' );
$router->add( '/:controller/:action' );
$router->add( '/:controller/:action/:id' );
$router->add( '/:controller/:action/:token' );
$router->add( '/:controller/:action.:format/:module-:do/:params/:statusCode' )
  ->regex( 'format', 'html|json' );

// or import from files
$router
  ->importFromArray( [
      '/test.php'  => [
          'matches'   => [
              'controller'    => 'test'
          ]
      ]
  ] )
  ->importFromFileArray( './routes.php' )
  ->importFromJson( './routes.json' )
  ->importFromXml( './routes.xml' );
```

Sample files
------------

[](#sample-files)

### `routes.json`

[](#routesjson)

```
{
  "/":{},
  "/:format/:module/:controller/:action": {
    "regex": {
      "format": "html|json"
    }
  }
}
```

### `routes.xml`

[](#routesxml)

```

```

### `routes.php`

[](#routesphp)

```
return [
  '/dashboard'    => [
    'matches'       => [
      'module'        => 'user-panel',
      'controller'    => 'index',
      'action'        => 'dashboard',
    ]
  ]
];
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

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

Recently: every ~76 days

Total

8

Last Release

3548d ago

### Community

Maintainers

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

---

Top Contributors

[![dez-php](https://avatars.githubusercontent.com/u/13887222?v=4)](https://github.com/dez-php "dez-php (3 commits)")

---

Tags

routerphp-routerdez-php router

### Embed Badge

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

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

###  Alternatives

[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.3k49.9M1.3k](/packages/slim-slim)[klein/klein

A lightning fast router for PHP

2.7k1.1M31](/packages/klein-klein)[slim/slim-skeleton

A Slim Framework skeleton application for rapid development

1.6k458.7k6](/packages/slim-slim-skeleton)[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)[rareloop/router

A powerful PHP Router for PSR7 messages inspired by the Laravel API

92178.9k4](/packages/rareloop-router)[yiisoft/router

Yii router

62321.8k21](/packages/yiisoft-router)

PHPackages © 2026

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