PHPackages                             danidoble/routing - 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. danidoble/routing

ActivePlugin[Framework](/categories/framework)

danidoble/routing
=================

A easy way to start with symfony-routing

v1.0.3(3y ago)063MITPHPPHP ^8.1

Since Sep 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/danidoble/routing)[ Packagist](https://packagist.org/packages/danidoble/routing)[ Docs](https://github.com/danidoble/routing)[ RSS](/packages/danidoble-routing/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (1)Dependencies (5)Versions (6)Used By (0)

Routing
=======

[](#routing)

A simple way to stat with symfony/routing

PHP 8.1 is required for version ^v1.0

```
composer require danidoble/routing

```

`Debug::enable();` This is only for debug mode, change it for a custom page, check [symfony/error-handler](https://github.com/symfony/error-handler)

Make a file named `.env` with

```
APP_URL="https://localhost/"
APP_DEBUG=true
APP_VIEW_DIR="views"

```

change localhost for your url site

```
use Symfony\Component\ErrorHandler\Debug;
use Danidoble\Routing\Route;
use Danidoble\Routing\Testing;

include __DIR__ . "/vendor/autoload.php";

// This is only for debug mode, change it for a custom page, check [symfony/error-handler](https://github.com/symfony/error-handler)
Debug::enable();

$base_path = __DIR__ . DIRECTORY_SEPARATOR; // base path of your project
$base_view_path = env('APP_VIEW_DIR','views'); // route of your directory of views
\Danidoble\Routing\View::$BASE_VIEW_PATH = $base_path . env('APP_VIEW_DIR'); // example: /home/your/project/views
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__");
$dotenv->load();
```

Instantiate Route of `\Danidoble\Routing\Route;`

```
$routes = new Route();

//add routes
$routes->add('/', [Testing::class, 'index'])->setMethods(['GET','POST']); //only get and post allowed
$routes->add('/help', [Testing::class, 'index'])->setMethods('GET'); //only get allowed
$routes->add('/danidoble', [Testing::class, 'index', 'a']); // all methods allowed

// dispatch
$routes->dispatch();
```

Creating route example

```
$path = "/lorem";//route slug
$controller = \Danidoble\Routing\Testing::class; // class/controller
$method = "index"; // method to execute
$route_name = "example_route"; // name of route

$routes->add($path,[$controller,$method,$route_name]);
```

In your controller

```
class Testing extends \Danidoble\Routing\Controller
{
    public function index()
    {
        //dump($this->getParent());
        //dump($this->param('demo'));
        dump($this->getParams());
    }
}
```

If you want to overwrite `__construct()` be sure to apply some code like below

```
public function __construct(RequestContext $_context, RouteCollection $_routes, UrlMatcher $_matcher, Route $_parent)
{
    parent::__construct($_context, $_routes, $_matcher, $_parent);
    // ... your code here
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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

Total

5

Last Release

1182d ago

Major Versions

v0.0.1 → v1.0.02022-08-14

PHP version history (2 changes)v0.0.1PHP ^7.3|^8.0

v1.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/2215f99c2b8dd234059f7658a737822ef9a79850dd0babf44658625f694ca086?d=identicon)[danidoble](/maintainers/danidoble)

---

Top Contributors

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

---

Tags

routingroutedanidoblephp-routing

### Embed Badge

![Health badge](/badges/danidoble-routing/health.svg)

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

###  Alternatives

[laravel/folio

Page based routing for Laravel.

608453.9k27](/packages/laravel-folio)[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)[izniburak/router

simple router class for php

23522.6k7](/packages/izniburak-router)[ecoal95/php-router

Minimal routing library

271.0k1](/packages/ecoal95-php-router)[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.4k](/packages/developermarius-simple-router)

PHPackages © 2026

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