我需要ZF2中的兩個不同的模板映射,一個用於admin和oen用於前端,目前我可以看到的是ZF2合併使用的2個module.config.php文件在我配置的2個模塊中,並導致我需要爲管理員設置的模板映射,以便在前面的模塊中加載。配置ZF2 view_manager加載2個單獨的模板地圖
的應用/ module.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',
),
...
的/管理員module.config.php
...
'view_manager' => array(
'template_path_stack' => array(
'admin' => __DIR__ . '/../view',
),
'template_map' => array(
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
),
),
...
我應該怎麼修改,這樣我可以加載單獨的 「view_manager」 陣列2個獨立的模塊?
爲什麼需要那個? –