我在 ZF2 中需要 2 个不同的模板映射,一个用于 admin 和 oen 用于前端,目前从我可以看到 ZF2 合并了在我配置的 2 个模块中使用的 2 个 module.config.php 文件,并导致模板映射我需要为管理员设置,也可以在前面的模块中加载。
/应用程序模块.config.php
...
'view_manager' => array(
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => array(
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
),
'template_path_stack' => array(
__DIR__ . '/../view',
),
...
/admin 模块.config.php
...
'view_manager' => array(
'template_path_stack' => array(
'admin' => __DIR__ . '/../view',
),
'template_map' => array(
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
),
),
...
我应该修改什么以便我可以为 2 个单独的模块加载单独的“view_manager”数组?