Zend_Navigation & Zend Router
I am looking for the solution of the problem of combining Zend_Navigation within multilanguagal page-setup with Routers.
I wrote several routers (eg '/:lang/:controller/:action'), which work fine. At the same time I use navigation.xml which has definitions like
<user>
<label>Users</label>
<uri>mdm/users</uri>
&开发者_如何学编程lt;/user>
I have to add dynamically the default language to the navigation. How can I do this?
Thanks a lot, Anatoliy
Why don't you set the default language in the route?
$router->addRoute('default', new Zend_Controller_Router_Route(
':lang/:controller/:action',
array(
'lang' => 'en',
'module' => 'default'
'controller' => 'index',
'action' => 'index'
)
));
Notice that I've replaced the "default" route as your routing scheme would match the default :module/:controller/:action
精彩评论