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
Posted by Andreas Linden (zolex) on 2012-09-02T13:33:02.000+0000
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' ),
Posted by Andreas Linden (zolex) on 2012-09-02T13:34:37.000+0000
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', ),
Posted by Jan Esser (esserj) on 2012-09-03T05:30:17.000+0000
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.
Posted by Andreas Linden (zolex) on 2012-09-03T10:00:02.000+0000
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.
Posted by sanp he (sanp) on 2012-09-12T09:16:02.000+0000
Is this bug fixed?
Posted by Ralph Schindler (ralph) on 2012-10-08T20:14:44.000+0000
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