Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zend framework2 ZF2如何在错误路由后隐藏消息错误_Zend Framework2_Routes - Fatal编程技术网

Zend framework2 ZF2如何在错误路由后隐藏消息错误

Zend framework2 ZF2如何在错误路由后隐藏消息错误,zend-framework2,routes,Zend Framework2,Routes,我想在错误的路由后返回404错误,而不是php致命错误长消息 Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'No RouteMatch instance provided' i 如何操作?在应用程序模块中的module.config数组中更改此选项: 'error/404' => __DIR__ . '/../view/error/40

我想在错误的路由后返回404错误,而不是php致命错误长消息

Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' 
with message 'No RouteMatch instance provided' i

如何操作?

在应用程序模块中的module.config数组中更改此选项:

'error/404'               => __DIR__ . '/../view/error/404.phtml'
或者只需在以下位置编辑
404.phtml
视图文件:

Application/view/error/404.phtml

谢谢你的确认。更改项目后,此模板工作正常,我将调试有问题的项目以找出问题所在。