duanhe1903 2016-01-03 11:48
浏览 42
已采纳

在app config中移动数组中的模块名称时,ZF2'无法呈现模板'

Good day. I've just started learning ZF2, replicated the Album example step-by-step, and then decided to make it a bit more interesting by adding user registration, and then make the two work together in some way, so i added a new 'Auth' module.

So, when i only had one module in the module list (aside from the Application module) in application.config.php, it was all fine, but when i added the Auth module to the list like so:

'modules' => array('Application', 'Album','Auth',)

i got the following error when trying to access any views from the album module which was working absolutely fine prior to this change:

Zend\View\Renderer\PhpRenderer::render: Unable to render template "album/album/index"; resolver could not resolve to a file

But when i changed the order in which the modules are presented in this array like so:

'modules' => array('Application', 'Auth','Album',)

not a single view (and it has only one) from the Auth module could be rendered, while the Album module was fine.

Zend\View\Renderer\PhpRenderer::render: Unable to render template "auth/user/index"; resolver could not resolve to a file

Both of these views exist at these locations, but the renderer doesn't see them for some reason.

You can see the project's contents here.

Thank you for any tips in advance.

  • 写回答

1条回答 默认 最新

  • duanji2002 2016-01-03 12:37
    关注

    Looks like you copy pasted the the view manager config for Auth module.config.php.

    This should be auth rather than album for your templates to work correctly.

    'view_manager' => array(
        'template_path_stack' => array(
            'auth' => __DIR__ . '/../view',
        ),
    ),
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计