Zend Naviation Menu View Helper - Are all links the same?

heres my setup:

http://www.example.com/<module>/<controller>/<action>

I defined this route:

$router->addRoute(
            'editUser', new Zend_Controller_Router_Route('admin/users/edit/:id',
                array(
                    'module'     => 'admin',
                    'controller' => 'users',
                    'action'     => 'edit',
                    'route'      => 'default',
                    'id'         => 0,
                ),
                array('id' => '\d+')
            )
        );

Thus, the navigation menu of my sites works fine until I go to the page:

http://www.example.com/admin/users/edit/10

It displays the page without problems, but now every link in the navigation menu points to http://www.example.com/admin/users/edit

Not sure why this is happening, and would like it to be fixed while maintaining router usage.

Thanks in advance for any pointers!

+3
source share
1 answer

This is a common problem.

If you use custom routes in your navigation (editUser in your case), you must explicitly pass the default route to the Zend_Navigation and url () pages.

+2
source

Source: https://habr.com/ru/post/1763287/


All Articles