PHPackages                             hickeroar/zf2-route-inheritance - 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. hickeroar/zf2-route-inheritance

ActiveLibrary[Framework](/categories/framework)

hickeroar/zf2-route-inheritance
===============================

Allows ZF2 routes to extend other routes, overriding options.

0.3.0(9y ago)17081[1 issues](https://github.com/hickeroar/zf2-route-inheritance/issues)MITPHPPHP &gt;=5.3.0

Since Apr 13Pushed 9y agoCompare

[ Source](https://github.com/hickeroar/zf2-route-inheritance)[ Packagist](https://packagist.org/packages/hickeroar/zf2-route-inheritance)[ Docs](https://github.com/hickeroar/zf2-route-inheritance/)[ RSS](/packages/hickeroar-zf2-route-inheritance/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (0)

RouteInheritance
================

[](#routeinheritance)

Allows ZF2 routes to extend other routes, overriding options.

Why?
----

[](#why)

```
I had some large and complicated routes set up for a project and needed to
"duplicate" the routes with alterations without having to copy, paste, and
modify the whole route array.

```

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

[](#installation)

- Use composer as described here:
- Add `RouteInheritance` to your `config/application.config.php`

Usage
-----

[](#usage)

```
'router' => [
    'routes' => [
        'my-original-route' => [
            'type' => 'literal',
            'options' => [
                'route'    => '/orig-url',
                'defaults' => [
                    'controller' => 'Application\Controller\IndexController',
                    'action'     => 'index',
                ],
            ],
        ],
    ],
    // "Copies" my-original-route to my-new-route and overrides/adds various things.
    // This currently uses a merge, so removing config keys is not supported.
    'inheritance' => [
        'my-new-route' => [
            'extends' => 'my-original-route',
            'configuration' => [
                'type' => 'segment',
                'options' => [
                    'route'    => '/new-url/:segment',
                    'constraints' => [
                        'segment' => '[a-zA-Z0-9_-]+',
                    ],
                    'defaults' => [
                        'controller' => 'Application\Controller\IndexController',
                        'action'     => 'new',
                    ],
                ],
            ],
        ],
    ],
],
```

License
-------

[](#license)

```
The MIT License (MIT)

Copyright (c) 2015 Ryan Vennell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% 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 ~135 days

Recently: every ~169 days

Total

6

Last Release

3376d ago

### Community

Maintainers

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

---

Top Contributors

[![hickeroar](https://avatars.githubusercontent.com/u/2441838?v=4)](https://github.com/hickeroar "hickeroar (9 commits)")[![pensiero](https://avatars.githubusercontent.com/u/2010696?v=4)](https://github.com/pensiero "pensiero (2 commits)")

---

Tags

frameworkroutingzf2routeextendoverride

### Embed Badge

![Health badge](/badges/hickeroar-zf2-route-inheritance/health.svg)

```
[![Health](https://phpackages.com/badges/hickeroar-zf2-route-inheritance/health.svg)](https://phpackages.com/packages/hickeroar-zf2-route-inheritance)
```

###  Alternatives

[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)[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)
