我试图做`$局部=阵列(DIR '/ menu.phtml', '默认'。);ZF2倾斜呈现局部导航
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
是什么问题?
显然文件不存在'/ module/Nav/view/layout/menu.phtml'这是所有的错误都给你。 – Sam
没有文件是存在的,如果世界上没有这样的文件它给另一个错误 – Cawa
我不知道,如果解析器可以处理的绝对路径。尝试将其设置为'layout/menu.phtml'。如果这仍然不起作用,解析器出现问题。在这种情况下,请回复我们,我们会检查您的配置。 **注意**我的评论中有一个错字。它必须是“layout/menu.phtml” - 不是“view/layout/menu.phtml”。 –