开发者

Zend_Navigation & Zend Router

开发者 https://www.devze.com 2023-01-25 00:41 出处:网络
I am looking for the solution of the problem of combining Zend_Navigation within multilanguagal page-setup with Routers.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消