2011-01-30 22 views
1

我已經配置我的Zend的導航菜單一樣Zend_Navigation菜單作品,但沒有面包屑

配置:http://pastebin.com/B212uWKz

public function _initNavigation() { 
    $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav'); 
    $navigation = new Zend_Navigation($config); 

    $this->bootstrap('view'); 
    $view = $this->getResource('view'); 
    $view->navigation($navigation); 
} 

佈局

<!DOCTYPE HTML> 
<html lang="en-US"> 
<head> 
    <meta charset="UTF-8"> 
    <title>Zend Navigation Test</title> 
</head> 
<body> 
    <?php echo $this->navigation()->menu(); ?> 
    <hr /> 
    <?php echo $this->navigation()->breadcrumbs(); ?> 
    <hr /> 
    <?php echo $this->layout()->content; ?> 
</body> 
</html> 

菜單作品,但不是breadbrumbs。我也是從here

<?php echo $this->navigation()->breadcrumbs() 
           ->setLinkLast(false) 
           ->setMinDepth(0) 
           ->render(); ?> 

試圖年僅菜單工程

回答

1

也許他們使用不同的容器?
也許最大深度?

<?php echo $this->navigation()->breadcrumbs() 
        ->setLinkLast(false) 
        ->setMinDepth(0) 
        ->setMaxDepth(500) 
        ->render($this->navigation()->getContainer()); ?> 
0

在你的代碼的樣子,我認爲這個問題可能是因爲您使用URI標籤而不是控制器行動標籤。例如,而不是:

<home> 
     <label>Home</label> 
     <uri>/</uri> 
    </home> 

應該有:

<home>    
     <label>Home</label> 
     <controller>index</controller> 
     <action>index</action> 
    </home> 

希望它會爲你工作。

+0

這不應該是這裏的問題。 – takeshin 2011-01-30 13:26:13