【发布时间】:2015-08-24 14:22:06
【问题描述】:
我有两个模块:
->Patient
->Doctor
project/ 指向Patient 模块,project/doctor 指向Doctor 模块。
所以当我输入project/forgotpass 时,它应该指向来自Patient 模块的404 错误页面,但它指向我的是Doctor 404 错误页面。
我怎样才能设法指向相应的 404 错误页面。
在Patient 模块配置中:
'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/patient' => __DIR__ . '/../view/layout/layout.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
),
'template_path_stack' => array(
__DIR__ . '/../view',
)
)
在Doctor 模块配置中:
'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/doctor' => __DIR__ . '/../view/layout/layout.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
),
'template_path_stack' => array(
__DIR__ . '/../view',
)
)
是否可以有单独的 404 页面,或者我应该调用相应的模块 404 错误页面。我的问题是Patient 模块正在调用Doctor 404 错误页面。
【问题讨论】:
标签: php templates module zend-framework2