ZF2-407: Url view helper gives urls that doesn't work when using index as action


Or it may be the other way around, that these routes should work but doesn't. Anyhow, there is a mismatch between the view helper and the route resolver. See my SO post here, where I encounter the issue:

I have a route like this:

'xmlcoverage' => array(
        'type'    => 'segment',
        'options' => array(
                'route' => '/xml/coverage[/:action][/:id]',
                'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                'defaults' => array(
                        'controller' => 'modulename/xmlcoverage',
                        'action'     => 'index',

I use the url view helper like this:

$this->url('xmlcoverage', array('action' => 'index', 'id' => $someid))

This gives me xml/coverage/33 which crashes. "The requested controller was unable to dispatch the request." I believe an id after the controller should map to index action, but it does not. But if it does not, at least the url helper should make the url work, like xml/coverage/index/33


This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: