0
我想undertsand爲什麼如果我設置$響應 - >的StatusCode(404);在我的onBootstrap()模塊方法中,我沒有創建dispach.error或render.error事件。如何使用異常stategy&RouteNotFoundStrategy
我有404頁面的呈現,但只是因爲statusCode已設置...沒有錯誤來報告報道?
謝謝。
我想undertsand爲什麼如果我設置$響應 - >的StatusCode(404);在我的onBootstrap()模塊方法中,我沒有創建dispach.error或render.error事件。如何使用異常stategy&RouteNotFoundStrategy
我有404頁面的呈現,但只是因爲statusCode已設置...沒有錯誤來報告報道?
謝謝。
您需要返回響應對象以將調度過程的其餘部分短路。修改後返回$響應應該會顯示404頁面。
我不確定返回回覆是否很好... [看這個](http://zend-framework-community.634137.n4.nabble.com/Throw-exception-and-havea-a- Status-404-Not-Found-response-td4655198.html) – BeRoots
我只能假定引用了控制器,因此引用了getResponse。如果調度過程認爲狀態應該正常,允許調度過程繼續將覆蓋您用200設置的404狀態。 – GeeH