PHPackages                             webcretaire/diggy-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. webcretaire/diggy-router

ActiveLibrary[Framework](/categories/framework)

webcretaire/diggy-router
========================

Simple routing component for PHP

v1.5.0(7y ago)0143MITPHPPHP &gt;=7.0.0

Since Jul 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Webcretaire/DiggyRouter)[ Packagist](https://packagist.org/packages/webcretaire/diggy-router)[ RSS](/packages/webcretaire-diggy-router/feed)WikiDiscussions master Synced 3w ago

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

DiggyRouter
===========

[](#diggyrouter)

[![Latest Stable Version](https://camo.githubusercontent.com/84234d76d848f5172097f70f54a4ce4f752c6cd562993f2f04035980a370572f/68747470733a2f2f706f7365722e707567782e6f72672f77656263726574616972652f64696767792d726f757465722f762f737461626c65)](https://packagist.org/packages/webcretaire/diggy-router)[![Total Downloads](https://camo.githubusercontent.com/6316ba4caf023ada3a62e6abc951ae14a61cd9a66e72c10b816e0d76aaa16dfd/68747470733a2f2f706f7365722e707567782e6f72672f77656263726574616972652f64696767792d726f757465722f646f776e6c6f616473)](https://packagist.org/packages/webcretaire/diggy-router)[![License](https://camo.githubusercontent.com/d2b88c59100f6634ee6aefc07d2c7ae46dd388d90659b21129222cdbd6637446/68747470733a2f2f706f7365722e707567782e6f72672f77656263726574616972652f64696767792d726f757465722f6c6963656e7365)](https://packagist.org/packages/webcretaire/diggy-router)[![Build Status](https://camo.githubusercontent.com/e645c6636e1d2d90eb896ae682129ba3dab9b18710e28dc179b8597ae0eb690c/68747470733a2f2f7472617669732d63692e6f72672f57656263726574616972652f4469676779526f757465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Webcretaire/DiggyRouter)

Simple routing component for php

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

[](#installation)

Currently the only way of installing is via composer :

```
composer require webcretaire/diggy-router
```

Basic Usage
-----------

[](#basic-usage)

First you have to register the routes you want to use in a YAML file with the following structure :

```
routes:
  # First Route
  - uri: '/addressOfYourPage'
    controller: 'Name\Of\A\Class'
    action: 'nameOfTheFunctionToCall'
  # Second Route
  - uri: '/addressOfYourSecondPage'
    controller: 'Name\Of\A\Class'
    action: 'nameOfTheFunctionToCall'
  # ...
```

Note that the "action" parameter is optionnal, if it is not provided the router will try to call a "render()" function with no parameters

Then create a new router :

```
$router = new DiggyRouter\Router()
```

Load your routes into the router :

```
$router->loadRoutes("path/to/your/routing.yml");
```

Use the router to call the correct function in the correct controller according to the requested URI :

```
$router->handleRequest();
```

Advanced usage
--------------

[](#advanced-usage)

By default the router tries to find a route that matches the requested URI which is stored in `$_SERVER['REQUEST_URI']`, but you can specify the URI to use by passing it to the function :

```
$router->handleRequest($customURI);
```

DiggyRouter now supports multiple URIs for one route, you just have define the `uri` parameter of your route as an array :

```
routes:
  - uri:
      - '/firstPage'
      - '/secondPage'
    controller: 'Name\Of\A\Class'
    action: 'nameOfTheFunctionToCall'
  # ...
```

If you have complex URIs, you can specify an expression that the requested URI must match. The default delimiter is '~' but you can specify which one to use by doing :

```
$router->setDelimiter('YourDelimiter');
```

If you have a lot of URIs, you can split your routes between one main routing file and as many secondary files as you want :

```
# Main routing file
includes:
  - 'secondRoutingFile'
  - 'thirdRoutingFile'

routes:
  - uri: '/SomeAdditionnalRoutes'
    controller: 'Name\Of\A\Class'
  # ...
```

```
# Second routing file
routes:
  - uri: '/RoutesEverywhere'
    controller: 'Name\Of\A\Class'
  # ...
```

Examples
--------

[](#examples)

You can see a full example in this [routing file](tests/DiggyRouter/Resources/routing.yml)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

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

Recently: every ~83 days

Total

18

Last Release

2913d ago

Major Versions

v0.0.3 → v1.0.02017-07-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/cdd9e1613907445b3a18294eeabb6cc8c2a3f3735d7a89173ec9e3b98b4b6c35?d=identicon)[Webcretaire](/maintainers/Webcretaire)

---

Top Contributors

[![Webcretaire](https://avatars.githubusercontent.com/u/12281309?v=4)](https://github.com/Webcretaire "Webcretaire (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webcretaire-diggy-router/health.svg)

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

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M462](/packages/pimcore-pimcore)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19564.8M1.6k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[getkirby/cms

The Kirby core

1.5k567.4k434](/packages/getkirby-cms)

PHPackages © 2026

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