Issues

ZF2-515: Console Application does not dispatch ControllerAction

Description

When defining a console route as described here(http://packages.zendframework.com/docs/latest/…) it's beeing matched by the console router but the defined controllerAction won't be dispatched. the eventmanager triggers dispatch.error and the application prints it's usage information.

Comments

when defining the route defaults as described here is does not work: http://packages.zendframework.com/docs/latest/…

'defaults' => array( 'controller' => 'User\Profile', 'action' => 'setpassword' ),

when providing the full classname for the controller it works:

'defaults' => array( 'controller' => 'User\Controller\Profile', 'action' => 'setpassword' ),

I think it would be best to define it in the same way as for http routes:

'defaults' => array( 'NAMESPACE' => 'User\Controller', 'controller' => 'Profile', 'action' => 'setpassword', ),

It seems that the way you call the controller is not in line with the documentation: in the documentation they assume the controller 'Application/Index' is found under the Controller folder (src/Controller/Application/Index.php) in the current namespace therefor specifying the full class path will in your case work. I do not believe this should be seen as a bug.

well in fact it is a bug, as the namespace is not defined. in http routes you can define it with the NAMESPACE key but this not possible for console routes.

Is this bug fixed?

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2550