ZF2 'unable to render template' 在应用程序配置中移动数组中的模块名称时

ZF2 'unable to render template' when shifting module names in the array in app config

美好的一天。 我刚开始学习 ZF2,一步一步复制 Album 示例,然后决定通过添加用户注册使其更有趣一点,然后以某种方式使两者一起工作,所以我添加了一个新的 'Auth'模块。

所以,当我在 application.config.php 的模块列表中只有一个模块(应用程序模块除外)时,一切都很好,但是当我像这样将 Auth 模块添加到列表中时:

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

我在尝试从相册模块访问任何视图时遇到以下错误,在此更改之前它工作得非常好:

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

但是当我像这样更改模块在这个数组中的显示顺序时:

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

无法呈现 Auth 模块中的单个视图(而且它只有一个),而 Album 模块没问题。

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

这两个视图都存在于这些位置,但由于某种原因渲染器看不到它们。

您可以看到项目的内容here

感谢您提前提供任何提示。

您似乎复制粘贴了 the view manager config for Auth module.config.php

这应该是 auth 而不是 album 以使您的模板正常工作。

'view_manager' => array(
    'template_path_stack' => array(
        'auth' => __DIR__ . '/../view',
    ),
),