2011-01-30 24 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