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',
        ),
    ),
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证