ZF-7763: Zend_Navigation_Page_Mvc generates incorrect urls using routes with *

Issue Type: Bug Created: 2009-09-02T12:59:31.000+0000 Last Updated: 2009-09-19T06:56:33.000+0000 Status: Resolved Fix version(s): Reporter: boris (jer) Assignee: Robin Skoglund (robinsk) Tags: - Zend_Navigation

Related issues: Attachments:


I've just started with ZF, so maybe its not actualy a bug, but for me its an unexpected thing. I'm using route with * modifier to accept additonal params via url. Next is code from docs, the only modification is "/*" in the end of the route

<pre class="highlight">
// the following route is added to the ZF router
    'article_view', // route name
    new Zend_Controller_Router_Route(
            'module'     => 'news',
            'controller' => 'article',
            'action'     => 'view',
            'id'         => null

// a page is created with a 'route' option
$page = new Zend_Navigation_Page_Mvc(array(
    'label'      => 'A news article',
    'route'      => 'article_view',
    'module'     => 'news',    // required for isActive(), see note above
    'controller' => 'article', // required for isActive(), see note above
    'action'     => 'view',    // required for isActive(), see note above
    'params'     => array('id' => 42)

// returns: /a/42
$href = $page->getHref();

Actualy will return /a/42/module/news/controller/article/action/view module, controller and action were treated as url parameters.


Posted by David Caunt (dcaunt) on 2009-09-02T13:02:47.000+0000

I've suffered from this problem as well - if its not a bug I think the manual may be missing some information.

Posted by Robin Skoglund (robinsk) on 2009-09-19T06:56:28.000+0000

The "weirdness" you experience is just the way Zend_Controller_Router* works, and it is not a bug.

Have you found an issue?

See the Overview section for more details.


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

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