-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm having problems generating navigation with Zend_Navigation.
I've got 2 custom routes, defined in the application.ini and am adding 2
pages to the navigation in the controller's init() method (I've also
tried pre and post dispatch methods - same result).

$this->getInvokeArg('bootstrap')
     ->getResource('navigation')
     ->addPages(array(
            'home' => array(
                'label' => 'View',
                'route' => 'cms:page:view',
            ),
            'edit' => array(
                'label' => 'Edit',
                'route' => 'cms:page:edit',
            ),
        ));

doing <?= $this->navigation() ?> in the view results in 2 links (as
expected) but only the link that is using the current route is correct.
The other link uses the default value for the "page" parameter ("index").
eg. at /test/ the links are to /test/ and /index/~edit
and at /test/~edit the links are /index/ and /test/~edit respectively

So, It seems that the navigation will only use the current parameters to
build the links when the link being built matches the current route
(confusing much?).

Is this expected behaviour? if so, is there a way to get it to behave in
the manner I am expecting?

For reference, This is the configuration of the routes.

resources.router.routes.cms:page:view.route = "([^~]+?)?/?"
resources.router.routes.cms:page:view.type =
"Zend_Controller_Router_Route_Regex"
resources.router.routes.cms:page:view.reverse = "%s/"
resources.router.routes.cms:page:view.defaults.module = "cms"
resources.router.routes.cms:page:view.defaults.controller = "page"
resources.router.routes.cms:page:view.defaults.action = "view"
resources.router.routes.cms:page:view.defaults.page = "index"
resources.router.routes.cms:page:view.map.1 = "page"

resources.router.routes.cms:page:edit.route = "([^~]+?)/~edit"
resources.router.routes.cms:page:edit.type =
"Zend_Controller_Router_Route_Regex"
resources.router.routes.cms:page:edit.reverse = "%s/~edit"
resources.router.routes.cms:page:edit.defaults.module = "cms"
resources.router.routes.cms:page:edit.defaults.controller = "page"
resources.router.routes.cms:page:edit.defaults.action = "edit"
resources.router.routes.cms:page:edit.defaults.page = "index"
resources.router.routes.cms:page:edit.map.1 = "page"

Thanks.

- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpyv8cACgkQ7bkAtAithutvswCdEtVJ25DaRpHhuOueSPypYV+C
RJcAn06BAzu7VOWWok2YVoGbRUh+TwYb
=dgxE
-----END PGP SIGNATURE-----

Reply via email to