PHPackages                             razzzila-dev/zf3-oldstyle-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. razzzila-dev/zf3-oldstyle-router

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

razzzila-dev/zf3-oldstyle-router
================================

N/A

00PHP

Since Mar 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/razzzila-dev/zf3-oldstyle-router)[ Packagist](https://packagist.org/packages/razzzila-dev/zf3-oldstyle-router)[ RSS](/packages/razzzila-dev-zf3-oldstyle-router/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Old style router for the Zend Framework 3
=========================================

[](#old-style-router-for-the-zend-framework-3)

[![GitHub license](https://camo.githubusercontent.com/dcfd4525b3e95551691fd645e2123a32a45c957703d551bb36ed0aa0f2a116ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e61657265656e2f5374726170446f776e2e6a732e737667)](https://choosealicense.com/licenses/mit/)[![Ask Me Anything !](https://camo.githubusercontent.com/f58000eb7d904f735fbbca30835a588c716bdde0781156f1fb2e601d44307a3a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f41736b2532306d652d616e797468696e672d3161626339632e737667)](mailto:dev@nikitaisakov.com?subject=%5BGitHub%5D%20Ask%20me%20anything)[![Contributions welcome](https://camo.githubusercontent.com/cade646491fa66c630684e56bcebb585d496841f5da6df2428ba9dea21b43597/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/razzzila-dev/golang-server-metrix-client/issues)

From ZF3 was removed router which find the controller and action using path from request and run it. For my own opinion this is a good thing and you should specify routes more clearly and harder. But still we have the problem when we migrate the codebase from ZF1 to ZF3 iteratively and in the first step we don't want to refactore pathes.

This is the answer - ready "old style" router which authomatically detect if the class and action exist run it. Also, it detect parameters in the query and allow to use them as previously (calling param method from the request).

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

[](#installation)

### Package install

[](#package-install)

#### Using Composer

[](#using-composer)

Change working directory to the project root folder and run:

```
composer require razzzila-dev/zf3-oldstyle-router
```

Usage
-----

[](#usage)

To configure your application for using this router we have to specify it in the router configuration. For doing so, open the your application configs/module.config.php and specify this router:

```
...

use Zend\Router\RouteInvokableFactory;
use Application\Router\Http\OldStyle as OldStyleRouter;
use Application\Controller\IndexController;

return [
    'router' => [
        'routes' => [
            'default' => [
                'type' => OldStyle::class,
                'options' => [
                    'route'    => '/[:controller[/:action[/]]]',
                    'defaults' => [
                        'controller' => IndexController::class,
                        'action'     => 'index',
                    ]
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [
            OldStyleRouter::class  => RouteInvokableFactory::class,
        ]
    ]
];
```

Under "defaults" section you can find the "controller" and "action" parameters. Here you can specify a fallback controller and action in case if controller and action from the request didn't found. To specify which module controllers will be used for searching in, you can use "module" option. By default this is "Application" module which means that for request "/index/index" we will search and trigger "Application\\Controller\\IndexController@indexAction".

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/29059c0e74271cca74c35f12be491e35066674e09575704fbf2443322f405227?d=identicon)[razzzila-dev](/maintainers/razzzila-dev)

---

Tags

routingzend-framework3zf3zf3-modulezf3-router

### Embed Badge

![Health badge](/badges/razzzila-dev-zf3-oldstyle-router/health.svg)

```
[![Health](https://phpackages.com/badges/razzzila-dev-zf3-oldstyle-router/health.svg)](https://phpackages.com/packages/razzzila-dev-zf3-oldstyle-router)
```

PHPackages © 2026

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