PHPackages                             coccoto/dotrouter - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. coccoto/dotrouter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

coccoto/dotrouter
=================

v1.2.1(4y ago)1321MITPHPPHP ^7.4

Since Feb 4Pushed 4y agoCompare

[ Source](https://github.com/coccoto/dotrouter)[ Packagist](https://packagist.org/packages/coccoto/dotrouter)[ RSS](/packages/coccoto-dotrouter/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (4)DependenciesVersions (5)Used By (1)

dotrouter
=========

[](#dotrouter)

It does a very simple routing.

Prerequisites
-------------

[](#prerequisites)

- PHP 7.4

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

[](#installation)

```
$ composer require coccoto/dotrouter
```

Usage
-----

[](#usage)

```
require_once 'vendor/autoload.php';

$map = [
    '/' => [
        'controller' => 'IndexController',
        'method' => 'indexMethod',
    ],
];

$namespace = 'app\\controllers\\';

$dotRouter = new coccoto\dotrouter\DotRouter();
$dotRouter->push($map, $namespace);
```

### Set the namespace.

[](#set-the-namespace)

```
$namespace = 'app\\controllers\\';
```

### Create a routing map.

[](#create-a-routing-map)

Path parameters can be used by preceding them with a colon.

```
$map = [
    '/' => [
        'controller' => 'IndexController',
        'method' => 'indexMethod',
    ],
    '/animal/page/:id' => [
        'controller' => 'CatController',
        'method' => 'foodMethod',
    ],
];
```

### Create a class to load.

[](#create-a-class-to-load)

PathParameter is placed in the property because it is inserted into the constructor argument of the loading class.

- app/controllers/FooController.php

```
namespace app\controllers;

class CatController {

    public array $pathParameter;

    public function __construct(array $pathParameter) {

        $this->pathParameter = $pathParameter;
    }

    public function foodMethod() {

        echo $this->pathParameter['id'];
    }
}
```

### Perform routing.

[](#perform-routing)

There are no more features and it's easy. Then start it.

```
~~~

$dotRouter = new coccoto\dotrouter\DotRouter();
$dotRouter->push($map, $namespace);
$dotRouter->run();
```

License
-------

[](#license)

MIT License

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Total

4

Last Release

1593d ago

### Community

Maintainers

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

---

Top Contributors

[![coccoto](https://avatars.githubusercontent.com/u/60543825?v=4)](https://github.com/coccoto "coccoto (9 commits)")

---

Tags

php

### Embed Badge

![Health badge](/badges/coccoto-dotrouter/health.svg)

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

PHPackages © 2026

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