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

<tfoot id='lZcMy'></tfoot>

<small id='lZcMy'></small><noframes id='lZcMy'>

    • <bdo id='lZcMy'></bdo><ul id='lZcMy'></ul>

      1. <legend id='lZcMy'><style id='lZcMy'><dir id='lZcMy'><q id='lZcMy'></q></dir></style></legend>

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

        如何從 Zend 只返回 JSON

        How to return only JSON from Zend(如何從 Zend 只返回 JSON)
          <tbody id='Ro3pi'></tbody>
        <legend id='Ro3pi'><style id='Ro3pi'><dir id='Ro3pi'><q id='Ro3pi'></q></dir></style></legend>

          <bdo id='Ro3pi'></bdo><ul id='Ro3pi'></ul>

          <small id='Ro3pi'></small><noframes id='Ro3pi'>

                • <tfoot id='Ro3pi'></tfoot>
                  <i id='Ro3pi'><tr id='Ro3pi'><dt id='Ro3pi'><q id='Ro3pi'><span id='Ro3pi'><b id='Ro3pi'><form id='Ro3pi'><ins id='Ro3pi'></ins><ul id='Ro3pi'></ul><sub id='Ro3pi'></sub></form><legend id='Ro3pi'></legend><bdo id='Ro3pi'><pre id='Ro3pi'><center id='Ro3pi'></center></pre></bdo></b><th id='Ro3pi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Ro3pi'><tfoot id='Ro3pi'></tfoot><dl id='Ro3pi'><fieldset id='Ro3pi'></fieldset></dl></div>
                  本文介紹了如何從 Zend 只返回 JSON的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我的項目使用 Zend Framework 1.x.我想為調用者函數創建一個只返回 JSON 字符串的 Web 服務.我嘗試使用 Zend_Controller_Action 并應用這些方法:

                  I'm using Zend Framework 1.x for my project. I want to create a Web service return only JSON string for the caller function. I tried to use Zend_Controller_Action and applied those ways:

                  1.

                  $this->getResponse()
                       ->setHeader('Content-type', 'text/plain')
                       ->setBody(json_encode($arrResult));
                  

                  2.

                  $this->_helper->getHelper('contextSwitch')
                                ->addActionContext('nctpaymenthandler', 'json')
                                ->initContext();
                  

                  3.

                  header('Content-type: application/json');
                  

                  4.

                  $this->_response->setHeader('Content-type', 'application/json');
                  

                  5.

                  echo Zend_Json::encode($arrResult);
                  exit;
                  

                  6.

                  return json_encode($arrResult);
                  

                  7.

                  $this->view->_response = $arrResult;
                  

                  但是當我使用 cURL 獲取結果時,它返回帶有一些 HTML 標記包圍的 JSON 字符串.然后我嘗試使用上述選項來使用 Zend_Rest_Controller.還是沒有成功.

                  But when I used cURL to get result, it returned with JSON string surrounded by some HTML tags. Then I tried to user Zend_Rest_Controller with the options above. It still did not success.

                  P.S.:以上大部分方法都來自 Stack Overflow 上提出的問題.

                  P.S.: Most of those ways above are from the question which had been asked on Stack Overflow.

                  推薦答案

                  我喜歡這種方式!

                  //encode your data into JSON and send the response
                  $this->_helper->json($myArrayofData);
                  //nothing else will get executed after the line above
                  

                  這篇關于如何從 Zend 只返回 JSON的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  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 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                    <tbody id='EiNDB'></tbody>

                  <tfoot id='EiNDB'></tfoot>

                  <small id='EiNDB'></small><noframes id='EiNDB'>

                    <bdo id='EiNDB'></bdo><ul id='EiNDB'></ul>
                      • <i id='EiNDB'><tr id='EiNDB'><dt id='EiNDB'><q id='EiNDB'><span id='EiNDB'><b id='EiNDB'><form id='EiNDB'><ins id='EiNDB'></ins><ul id='EiNDB'></ul><sub id='EiNDB'></sub></form><legend id='EiNDB'></legend><bdo id='EiNDB'><pre id='EiNDB'><center id='EiNDB'></center></pre></bdo></b><th id='EiNDB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EiNDB'><tfoot id='EiNDB'></tfoot><dl id='EiNDB'><fieldset id='EiNDB'></fieldset></dl></div>

                            <legend id='EiNDB'><style id='EiNDB'><dir id='EiNDB'><q id='EiNDB'></q></dir></style></legend>

                            主站蜘蛛池模板: 国产成人叼嘿视频在线观看 | 一级毛片色一级 | 888久久久| 中文字幕在线免费观看 | 免费在线视频a | 久久丝袜视频 | 九九热在线免费视频 | 亚洲二区在线 | 成人久久久 | 成人夜晚看av | 精品久久久久久中文字幕 | 日韩一区二区在线视频 | 久久久久亚洲精品 | 国产视频不卡一区 | 精品不卡 | 夜操| 日韩欧美国产一区二区三区 | 日本国产高清 | 91精品久久久久久久久久入口 | 无码日韩精品一区二区免费 | 一区二区三区欧美在线观看 | 国产美女在线观看 | 色网在线播放 | 黄色免费看 | 成人毛片网 | 久久99国产精一区二区三区 | 国产一级在线观看 | 九九热在线视频免费观看 | 在线午夜 | 99小视频| 日日草夜夜草 | 亚洲精品在线免费看 | 亚洲欧洲精品在线 | 国产精品久久久久免费 | 久久精品日 | 中文字幕视频在线观看 | 成人欧美在线 | 蜜桃精品噜噜噜成人av | 欧美在线激情 | 欧美日韩久| 蜜桃精品噜噜噜成人av |