0

我正在尝试做` $partial = array( DIR .'/menu.phtml', 'default');

  echo $this->navigation()->menu()->setPartial($partial);`

我得到错误Fatal error: Zend\View\Exception\RuntimeException: Zend\View\Renderer\PhpRenderer::render: Unable to render template "/home/cawa/www/zf2/module/Nav/view/layout/menu.phtml"; resolver could not resolve to a file in /home/cawa/www/zf2/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/AbstractHelper.php on line 471

问题是什么?

4

2 回答 2

0

还要注意菜单的命名——如果“导航”关键字不存在,那么部分中的容器对我来说是空的。

<?= $this->navigation()->menu('navigation')->setPartial(array('partials/menu.phtml', 'default'))->render() ?>
于 2013-01-15T13:54:09.677 回答
-1

http://www.zfforum.de/einsteigerfragen/4749-zend_navigation-aktiver-eintrag-im-partial.html

于 2012-09-28T12:40:34.203 回答