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

时间:2013-09-20 01:17:42

标签: zend-framework2 routes

我想在错误的路由后返回404错误而不是php Fatal Error长消息。

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

我该怎么做?

1 个答案:

答案 0 :(得分:0)

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

'error/404'               => __DIR__ . '/../view/error/404.phtml'

或者只需编辑404.phtml视图文件:

Application/view/error/404.phtml