2010-03-18 50 views
1

如何在xml中的不同部分呈現Zend_Navigation? 這裏我的XML如何在xml中的不同部分呈現Zend_Navigation?

<configdata> 
    <admin> 
     ..... 
    </admin> 
    <default> 
     ..... 
    </default> 
</configdata> 

我已經測試這一點,但渲染菜單中得到相同的結果,部分管理

$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); 

回答

0

可以選擇直接通過Zend_Navigation_Container導航視圖助手:

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