pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<small id='62D5s'></small><noframes id='62D5s'>

<i id='62D5s'><tr id='62D5s'><dt id='62D5s'><q id='62D5s'><span id='62D5s'><b id='62D5s'><form id='62D5s'><ins id='62D5s'></ins><ul id='62D5s'></ul><sub id='62D5s'></sub></form><legend id='62D5s'></legend><bdo id='62D5s'><pre id='62D5s'><center id='62D5s'></center></pre></bdo></b><th id='62D5s'></th></span></q></dt></tr></i><div class="w2em22k" id='62D5s'><tfoot id='62D5s'></tfoot><dl id='62D5s'><fieldset id='62D5s'></fieldset></dl></div>
<legend id='62D5s'><style id='62D5s'><dir id='62D5s'><q id='62D5s'></q></dir></style></legend>

      1. <tfoot id='62D5s'></tfoot>
        • <bdo id='62D5s'></bdo><ul id='62D5s'></ul>

        Zend 框架 2 推薦的錯誤處理方式

        Zend framework 2 recommended way for error handling(Zend 框架 2 推薦的錯誤處理方式)

          • <bdo id='BnzsN'></bdo><ul id='BnzsN'></ul>
            <tfoot id='BnzsN'></tfoot>
            <i id='BnzsN'><tr id='BnzsN'><dt id='BnzsN'><q id='BnzsN'><span id='BnzsN'><b id='BnzsN'><form id='BnzsN'><ins id='BnzsN'></ins><ul id='BnzsN'></ul><sub id='BnzsN'></sub></form><legend id='BnzsN'></legend><bdo id='BnzsN'><pre id='BnzsN'><center id='BnzsN'></center></pre></bdo></b><th id='BnzsN'></th></span></q></dt></tr></i><div class="02qac2a" id='BnzsN'><tfoot id='BnzsN'></tfoot><dl id='BnzsN'><fieldset id='BnzsN'></fieldset></dl></div>
            <legend id='BnzsN'><style id='BnzsN'><dir id='BnzsN'><q id='BnzsN'></q></dir></style></legend>
                  <tbody id='BnzsN'></tbody>
              • <small id='BnzsN'></small><noframes id='BnzsN'>

                  本文介紹了Zend 框架 2 推薦的錯誤處理方式的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我注意到 Zend 提供的 Skeleton Application 不能處理 error 500.我知道在 ZF1 中有一個 ErrorController 來處理這個問題.我在網(wǎng)上做了一些研究,但沒有找到明確的解決方案.

                  I noticed that the Skeleton Application that Zend provides does not handle error 500. I know that in ZF1 there was an ErrorController that took care of that. I have done some research online, but did not find a clear cut solution for this.

                  那么在 ZF2 中處理錯誤的最佳方法是什么?是基于每個模塊還是某些全局異常/錯誤處理程序?

                  So what is the best way for error handling in ZF2. Would it be on per module basis or some global exception/error handler?

                  我知道另一種解決方案是將 ini_set('display_errors', true); 添加到我的 index.php 中,但我不太喜歡那個解決方案.框架似乎應該提供一些處理錯誤的方法.

                  I know that another solution would be to add ini_set('display_errors', true); to my index.php, but I don't really like that solution. It seems that the framework should provide some way for handling errors.

                  推薦答案

                  您可以在捕獲異常后以任何方式處理異常,例如以下示例,其中全局捕獲異常...:

                  You can handle the exceptions in anyway you want after catching it as the following example in which you are catching the exception globally...:

                  在你的Module.php中的onBootstrap方法中,你可以附加一個在事件發(fā)生時執(zhí)行的函數(shù),下面附加一個在發(fā)生錯誤時執(zhí)行的函數(shù)(異常)引發(fā):

                  In the onBootstrap method in your Module.php you can attach a function to execute when an event occurs, the following attach a function to be executed when an error (exception) is raised:

                  public function onBootstrap(MvcEvent $e)
                  {
                      $application = $e->getApplication();
                      $em = $application->getEventManager();
                      //handle the dispatch error (exception) 
                      $em->attach(endMvcMvcEvent::EVENT_DISPATCH_ERROR, array($this, 'handleError'));
                      //handle the view render error (exception) 
                      $em->attach(endMvcMvcEvent::EVENT_RENDER_ERROR, array($this, 'handleError'));
                  }
                  

                  然后定義函數(shù)以任何你想要的方式處理錯誤,下面是一個例子:

                  and then define the function to handle the error in any way you want, the following is an example:

                  public function handleError(MvcEvent $e)
                  {
                      //get the exception
                      $exception = $e->getParam('exception');
                      //...handle the exception... maybe log it and redirect to another page, 
                      //or send an email that an exception occurred...
                  }
                  

                  這篇關(guān)于Zend 框架 2 推薦的錯誤處理方式的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)

                      <tfoot id='bKMti'></tfoot>
                        <tbody id='bKMti'></tbody>
                        <bdo id='bKMti'></bdo><ul id='bKMti'></ul>
                        <legend id='bKMti'><style id='bKMti'><dir id='bKMti'><q id='bKMti'></q></dir></style></legend>
                        1. <small id='bKMti'></small><noframes id='bKMti'>

                        2. <i id='bKMti'><tr id='bKMti'><dt id='bKMti'><q id='bKMti'><span id='bKMti'><b id='bKMti'><form id='bKMti'><ins id='bKMti'></ins><ul id='bKMti'></ul><sub id='bKMti'></sub></form><legend id='bKMti'></legend><bdo id='bKMti'><pre id='bKMti'><center id='bKMti'></center></pre></bdo></b><th id='bKMti'></th></span></q></dt></tr></i><div class="oye46me" id='bKMti'><tfoot id='bKMti'></tfoot><dl id='bKMti'><fieldset id='bKMti'></fieldset></dl></div>

                            主站蜘蛛池模板: 六自由度平台_六自由度运动平台_三自由度摇摆台—南京全控科技 | 防爆暖风机_防爆电暖器_防爆电暖风机_防爆电热油汀_南阳市中通智能科技集团有限公司 | 电机修理_二手电机专家-河北豫通机电设备有限公司(原石家庄冀华高压电机维修中心) | 武汉高温老化房,恒温恒湿试验箱,冷热冲击试验箱-武汉安德信检测设备有限公司 | 电机保护器-电动机综合保护器-浙江开民| 双工位钻铣攻牙机-转换工作台钻攻中心-钻铣攻牙机一体机-浙江利硕自动化设备有限公司 | 手板_手板模型制作_cnc手板加工厂-东莞天泓 | 上海噪音治理公司-专业隔音降噪公司-中广通环保 | 懂研帝_专业SCI论文润色机构_SCI投稿发表服务公司 | 电主轴,车床电磨头,变频制动电机-博山鸿达特种电机 | 防伪溯源|防窜货|微信二维码营销|兆信_行业内领先的防伪防窜货数字化营销解决方案供应商 | 连续密炼机_双转子连续密炼机_连续式密炼机-南京永睿机械制造有限公司 | PO膜_灌浆膜及地膜供应厂家 - 青州市鲁谊塑料厂 | 家德利门业,家居安全门,别墅大门 - 安徽家德利门业有限公司 | 重庆网站建设,重庆网站设计,重庆网站制作,重庆seo,重庆做网站,重庆seo,重庆公众号运营,重庆小程序开发 | 碳纤维复合材料制品生产定制工厂订制厂家-凯夫拉凯芙拉碳纤维手机壳套-碳纤维雪茄盒外壳套-深圳市润大世纪新材料科技有限公司 | 中空玻璃生产线,玻璃加工设备,全自动封胶线,铝条折弯机,双组份打胶机,丁基胶/卧式/立式全自动涂布机,玻璃设备-山东昌盛数控设备有限公司 | 天津仓库出租网-天津电商仓库-天津云仓一件代发-【博程云仓】 | 智能案卷柜_卷宗柜_钥匙柜_文件流转柜_装备柜_浙江福源智能科技有限公司 | 依维柯自动挡房车,自行式国产改装房车,小型房车价格,中国十大房车品牌_南京拓锐斯特房车 - 南京拓锐斯特房车 | 变位机,焊接变位机,焊接变位器,小型变位机,小型焊接变位机-济南上弘机电设备有限公司 | 企业微信营销_企业微信服务商_私域流量运营_艾客SCRM官网 | 不锈钢钢格栅板_热浸锌钢格板_镀锌钢格栅板_钢格栅盖板-格美瑞 | 建筑资质代办-建筑资质转让找上海国信启航 | 冷油器,取样冷却器,热力除氧器-连云港振辉机械设备有限公司 | 铝合金重力铸造_铝合金翻砂铸造_铝铸件厂家-东莞市铝得旺五金制品有限公司 | 消电检公司,消电检价格,北京消电检报告-北京设施检测公司-亿杰(北京)消防工程有限公司 | 佛山商标注册_商标注册代理|专利注册申请_商标注册公司_鸿邦知识产权 | 回转炉,外热式回转窑,回转窑炉-淄博圣元窑炉工程有限公司 | 西安展台设计搭建_西安活动策划公司_西安会议会场布置_西安展厅设计西安旭阳展览展示 | 成都茶楼装修公司 - 会所设计/KTV装修 - 成都朗煜装饰公司 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库-首页-东莞市傲马网络科技有限公司 | 包装盒厂家_纸盒印刷_礼品盒定制-济南恒印包装有限公司 | 西子馋火锅鸡加盟-太原市龙城酉鼎餐饮管理有限公司 | 交通信号灯生产厂家_红绿灯厂家_电子警察监控杆_标志杆厂家-沃霖电子科技 | 北京印刷厂_北京印刷_北京印刷公司_北京印刷厂家_北京东爵盛世印刷有限公司 | 天津云仓-天津仓储物流-天津云仓一件代发-顺东云仓 | 粘度计NDJ-5S,粘度计NDJ-8S,越平水分测定仪-上海右一仪器有限公司 | 隧道风机_DWEX边墙风机_SDS射流风机-绍兴市上虞科瑞风机有限公司 | 食安观察网 | 超声波_清洗机_超声波清洗机专业生产厂家-深圳市好顺超声设备有限公司 |