PHPackages                             bilhackmac/routes-match-inverter-module - 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. bilhackmac/routes-match-inverter-module

ActiveThelia-module[Utility &amp; Helpers](/categories/utility)

bilhackmac/routes-match-inverter-module
=======================================

Allows to match the routes in reverse modules order

v1.1.0(10y ago)2448LGPL-3.0+PHP

Since Mar 25Pushed 10y ago7 watchersCompare

[ Source](https://github.com/thelia-modules/RoutesMatchInverter)[ Packagist](https://packagist.org/packages/bilhackmac/routes-match-inverter-module)[ RSS](/packages/bilhackmac-routes-match-inverter-module/feed)WikiDiscussions master Synced 1mo ago

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

Thelia 2 Routes Match Inverter
==============================

[](#thelia-2-routes-match-inverter)

Allows to match the routes in reverse modules order

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

[](#installation)

### Manually…

[](#manually)

Copy the module into `/local/modules/` directory and be sure that the name of the module is `RoutesMatchInverter`.

### … or with Composer

[](#-or-with-composer)

Add it in your main thelia `composer.json` file

```
composer require bilhackmac/routes-match-inverter-module:~1.0

```

### Then

[](#then)

Activate it in your thelia administration panel.

Explanation
-----------

[](#explanation)

In Thelia 2 you can overwrite any module loop/form/service by configuring in an other module an loop/form/service with the same id and by setting this module under (with greater position) the other in modules list. But it's not working in this way for routes

Consider module A, B and C configuration files :

*ModuleA/Config/config.xml*

```

```

*ModuleA/Config/routing.xml*

```

    ModuleA:Main:index

```

*ModuleB/Config/config.xml*

```

```

*ModuleB/Config/routing.xml*

```

    ModuleB:Main:index

```

*ModuleC/Config/config.xml*

```

```

*ModuleC/Config/routing.xml*

```

    ModuleC:Main:index

```

Now, in any controller, if you call `$this->container->get('my.super.service')`, you always get the **most** overridden module service (by greatest module position) **BUT**, in your browser/RESTClient, if you call `/my/super/route`, you always match the **less** (first matching) overridden module route.

A small table can be clearer :

Module positionService from moduleCalled controller (from route configuration)`A < B < C``C``ModuleA:Main:index``A < C < B``B``ModuleA:Main:index``B < C < A``A``ModuleB:Main:index``C < B < A``A``ModuleC:Main:index``C < A < B``B``ModuleC:Main:index`A way to prevent this behaviour is to define your own router ([Thelia doc](http://doc.thelia.net/en/documentation/modules/routing.html#custom-routing)) but it can be boring or just a third module on which you do not have the hand.

So this module reverse the way that routes match for modules without defined router, and this is where the magic happens, previous table become :

Module positionService from moduleCalled controller (from route configuration)`A < B < C``C``ModuleC:Main:index``A < C < B``B``ModuleB:Main:index``B < C < A``A``ModuleA:Main:index``C < B < A``A``ModuleA:Main:index``C < A < B``B``ModuleB:Main:index`

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

4011d ago

### Community

Maintainers

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

---

Top Contributors

[![bilhackmac](https://avatars.githubusercontent.com/u/3740078?v=4)](https://github.com/bilhackmac "bilhackmac (7 commits)")

### Embed Badge

![Health badge](/badges/bilhackmac-routes-match-inverter-module/health.svg)

```
[![Health](https://phpackages.com/badges/bilhackmac-routes-match-inverter-module/health.svg)](https://phpackages.com/packages/bilhackmac-routes-match-inverter-module)
```

PHPackages © 2026

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