zf2无法渲染部分导航

时间:2012-09-21 08:06:56

标签: zend-framework2 partials zend-view zend-navigation

我正在尝试`$ 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

问题是什么?

2 个答案:

答案 0 :(得分:0)

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

<?= $this->navigation()->menu('navigation')->setPartial(array('partials/menu.phtml', 'default'))->render() ?>

答案 1 :(得分:-1)

相关问题