ZF2-515: Console Application does not dispatch ControllerAction

Issue Type: Bug Created: 2012-09-02T13:27:05.000+0000 Last Updated: 2012-10-08T20:14:44.000+0000 Status: Closed Fix version(s): Reporter: Andreas Linden (zolex) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Console

  • Zend\Mvc

Related issues: Attachments:


When defining a console route as described here(…) 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.


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:…

'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:

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.