ZF2:禁用错误页面布局 [英] ZF2 : disable error page layout

查看:203
本文介绍了ZF2:禁用错误页面布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的zf2模块中显示错误/异常页面时禁用布局

im trying to disable layout while showing error/exception page in my zf2 module

但没有任何作用

请帮助

推荐答案

我的Module.php中的最终解决方案

Final Solution in my Module.php

$eventManager = $e->getApplication()->getEventManager();



        $eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, function($e) {
             $result = $e->getResult();
             $result->setTerminal(TRUE);

            });

它工作,只加载错误/ 404查看文件不是布局文件

it works and only loads error/404 view file not the layout file

谢谢安德鲁

这篇关于ZF2:禁用错误页面布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆