ZF2には2つの異なるテンプレートマップが必要です。1つは管理者用、もう1つはフロントエンド用です。現在ZF2は、構成した2つのモジュールで使用されている2つのmodule.config.phpファイルをマージし、テンプレートマップを作成します。管理者がフロントモジュールにもロードされるように設定する必要があります。
/Application 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',
),
...
/admin module.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」配列をロードできるようにするには、何を変更する必要がありますか?