久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<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="qwawimqqmiuu" 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 推薦的錯(cuò)誤處理方式

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

          • <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="qwawimqqmiuu" 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 推薦的錯(cuò)誤處理方式的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我注意到 Zend 提供的 Skeleton Application 不能處理 error 500.我知道在 ZF1 中有一個(gè) ErrorController 來處理這個(gè)問題.我在網(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 中處理錯(cuò)誤的最佳方法是什么?是基于每個(gè)模塊還是某些全局異常/錯(cuò)誤處理程序?

                  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 中,但我不太喜歡那個(gè)解決方案.框架似乎應(yīng)該提供一些處理錯(cuò)誤的方法.

                  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方法中,你可以附加一個(gè)在事件發(fā)生時(shí)執(zhí)行的函數(shù),下面附加一個(gè)在發(fā)生錯(cuò)誤時(shí)執(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ù)以任何你想要的方式處理錯(cuò)誤,下面是一個(gè)例子:

                  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 推薦的錯(cuò)誤處理方式的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 可滾動(dòng)游標(biāo)不起作用)
                  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 獲取一個(gè)值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)

                      <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="qwawimqqmiuu" id='bKMti'><tfoot id='bKMti'></tfoot><dl id='bKMti'><fieldset id='bKMti'></fieldset></dl></div>

                            主站蜘蛛池模板: 久久av综合 | 激情五月婷婷 | 久久99国产精一区二区三区 | 伊人久久麻豆 | 欧美xxxx日本 | 日产精品久久久一区二区福利 | 精产嫩模国品一二三区 | 午夜精品福利视频 | 亚洲情侣视频 | 一级a性色生活片久久毛片 午夜精品在线观看 | 国产精品中文字幕在线 | 欧美成人久久 | 亚洲成年影院 | 成人国产在线观看 | 中文一区二区 | 黄色一级片视频 | 国产精品 欧美精品 | 麻豆changesxxx国产 | 日韩欧美国产精品一区二区 | 国产精品久久久久国产a级 欧美日韩国产免费 | 国产一区二区三区免费观看在线 | 性一交一乱一伦视频免费观看 | 超碰精品在线 | 午夜三区 | 激情免费视频 | 欧美日本在线观看 | 色频| 男人av的天堂 | 国产精品一区二区不卡 | 国产成人精品综合 | 国产日韩免费视频 | 免费国产视频 | 久久精品二区 | 韩日一区二区三区 | 中国大陆高清aⅴ毛片 | 成人av激情| 日韩一级黄色毛片 | 成年人在线视频 | 九九热热九九 | 久久久涩 | 大香在线伊779|