ZF2 - How to change the error/404 response page? Not just template but to set a new ViewModel

前端 未结 7 2438
离开以前
离开以前 2021-01-05 22:46

By default the page is set like this in the Application module.config array:

\'template_map\' => array(
    \'error/404\' => __DIR__ . \'/         


        
7条回答
  •  迷失自我
    2021-01-05 23:30

    You should first detach default notfoundstrategy and in your Module.php and in case of a 404, you should return a new viewmodel from the controller. Please see this post: http://www.cagataygurturk.com/zf2-controller-specific-not-found-page/

提交回复
热议问题