Issues

ZF-11582: Dispatcher incorrectly transforms camelCased controller names into class names

Description

There is a method formatControllerName() in Zend_Controller_Dispatcher_Abstract class. Given the controller name like 'configurationTestGroups' it converts it into 'ConfigurationtestgroupsController'.

Problem arised when I was using custom routes like this (via application.ini): resources.router.routes.cfgApp.route = "/configuration/testGroups/:action/*" resources.router.routes.cfgApp.defaults.controller = "configurationTestGroups" resources.router.routes.cfgApp.defaults.action = "index"

Comments

Within the MVC, the controller and action names are passed lower-case; this helps ensure that the URLs may be case insensitive. As such, in order to translate these tokens to the MixedCase of class names or camelCase of method names, you need to introduce word separators -- usually "." or "-".

So, change this:


resources.router.routes.cfgApp.defaults.controller = "configurationTestGroups"

to this:


resources.router.routes.cfgApp.defaults.controller = "configuration-test-groups"

and the dispatcher should now invoke the ConfigurationTestGroupsController.