开发者

How to render Zend_Navigation in different section in xml?

开发者 https://www.devze.com 2022-12-23 21:35 出处:网络
How to render Zend_Navigation in different section in xml? Here my xml <configdata> <admin> .....

How to render Zend_Navigation in different section in xml? Here my xml

<configdata>
    <admin>
        .....
    </admin>
    <default>
        .....
    </default>
</configdata>
开发者_JAVA技巧

I'm already testing this but render of menu get same result section admin

$navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'default');
$navContainer       = new Zend_Navigation($navContainerConfig);

$view->navigation = $view->navigation()->setAcl($this->acl)->setRole($role)->menu($navContainer);

$navContainerConfig     = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'admin');
$navContainer           = new Zend_Navigation($navContainerConfig);
$view->navigationAdmin  = $view->navigation()->setAcl($this->acl)->setRole($role)->menu($navContainer);


You have to pass the Zend_Navigation_Container directly to the navigation view helper:

$view->navigationDefault = $view->navigation($defaultNavContainer)->setAcl($this->acl)->setRole($role);
$view->navigationAdmin = $view->navigation($adminNavContainer)->setAcl($this->acl)->setRole($role);
0

精彩评论

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