Skip to content
ZF1-style routing for ZF2
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Version 0.0.1 Created by Evan Coury


This module provides basic ZF1-style automatic routing to ZF2.

This module was developed in response to this thread on the ZF-Contributor mailing list. I do not personally use or endorse the use of this module. It is being provided on an AS-IS basis for those who prefer this sort of automatic routing in their applications. My opinion is that routes are generally better off being defined explicitly by modules themselves.

The logic used when resolving the URL to controller classes is as follows:

 - check for 'foo' DI alias
 - Foo\Controller\IndexController::indexAction()
 - Application\Controller\FooController::indexAction()

 - check for 'foo-bar' DI alias
 - FooBar\Controller\IndexController::indexAction()
 - Application\Controller\FooBarController::indexAction()

 - check for 'foo' DI alias
 - Foo\Controller\BarController::indexAction()
 - Application\Controller\FooController::barAction()

 - check for 'foo' DI alias
 - Foo\Controller\BarController::bazAction()


Currently, in order to override the default route in the config, this module must be enabled AFTER your Application module in configs/application.config.php.


  • This does not yet support param/value/param/value parameters.
  • This does not prevent modules from overriding the view script paths of other modules with controllers of the same name.
Something went wrong with that request. Please try again.