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

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

      <tfoot id='RJu5J'></tfoot>

      <legend id='RJu5J'><style id='RJu5J'><dir id='RJu5J'><q id='RJu5J'></q></dir></style></legend>
        <bdo id='RJu5J'></bdo><ul id='RJu5J'></ul>

      <i id='RJu5J'><tr id='RJu5J'><dt id='RJu5J'><q id='RJu5J'><span id='RJu5J'><b id='RJu5J'><form id='RJu5J'><ins id='RJu5J'></ins><ul id='RJu5J'></ul><sub id='RJu5J'></sub></form><legend id='RJu5J'></legend><bdo id='RJu5J'><pre id='RJu5J'><center id='RJu5J'></center></pre></bdo></b><th id='RJu5J'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RJu5J'><tfoot id='RJu5J'></tfoot><dl id='RJu5J'><fieldset id='RJu5J'></fieldset></dl></div>
    1. 使用 Zend Action Helper ContextSwitch 創(chuàng)建自定義 JSON 響

      Creating a custom JSON response object with Zend Action Helper ContextSwitch(使用 Zend Action Helper ContextSwitch 創(chuàng)建自定義 JSON 響應(yīng)對象)

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

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

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

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

              • 本文介紹了使用 Zend Action Helper ContextSwitch 創(chuàng)建自定義 JSON 響應(yīng)對象的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我通常會在響應(yīng)正文中附加一個(gè)編碼的 json 對象,但是現(xiàn)在我遇到了需要使用 ContextSwitch 操作助手的情況.

                I normally append an encoded json object to the response body, however I now have a situation that warrants using the ContextSwitch action helper.

                我有一個(gè) Zend_Form 需要三個(gè)不同的響應(yīng)上下文:

                I have a Zend_Form that requires three different response contexts:

                1. html - 將表單呈現(xiàn)為普通的 html在布局內(nèi).
                2. html-partial - 呈現(xiàn)的 ajaxget"請求只是表單為 html.
                3. json - 返回的 ajaxpost"請求任何形式驗(yàn)證錯(cuò)誤消息.
                1. html - Render the form as normal html within a layout.
                2. html-partial - An ajax "get" request that renders just the form as html.
                3. json - An ajax "post" request that returns any form valiation error messages.

                對于每個(gè)上下文,我有 3 個(gè)視圖腳本.雖然這兩個(gè)html上下文可以使用同一個(gè)視圖腳本,但是我還沒有弄清楚這是否可能.

                For each context I have 3 view scripts. Although the two html contexts could use the same view script, but I haven't figured out if this is possible.

                • form.phtml
                • form.html.phtml
                • form.json.phtml

                html 上下文視圖可以正常工作,但是 json 視圖沒有被選中.覆蓋默認(rèn) json post 回調(diào)行為或?qū)⒆远x編碼對象傳遞給響應(yīng)正文的最佳方法是什么?

                The html context views work okay, but the json view is not being picked up. What is the best method to override the default json post callback behaviour or pass a custom encoded object to the response body?

                推薦答案

                就我個(gè)人而言,我不使用視圖"來生成 JSON 內(nèi)容.在我的 init() 中,我有這樣的東西:

                Personally, I don't use "View" to generate JSON content. In my init(), I have something like this:

                $ajaxContext = $this->_helper->getHelper('AjaxContext');
                $ajaxContext->setAutoJsonSerialization(false)
                    ->addActionContext('index', array('html', 'json'))
                    ->initContext();
                

                在我的indexAction()中:

                if ( true === $this->isAjaxJson() ) {
                    $this->_helper->json(
                        array(
                            'response' => $myResponse,
                            'message' => $myMesage
                        )
                    );
                    return;
                }
                

                希望對您有所幫助.

                這篇關(guān)于使用 Zend Action Helper ContextSwitch 創(chuàng)建自定義 JSON 響應(yīng)對象的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 可滾動游標(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ū)動程序)
              • <i id='dvw7j'><tr id='dvw7j'><dt id='dvw7j'><q id='dvw7j'><span id='dvw7j'><b id='dvw7j'><form id='dvw7j'><ins id='dvw7j'></ins><ul id='dvw7j'></ul><sub id='dvw7j'></sub></form><legend id='dvw7j'></legend><bdo id='dvw7j'><pre id='dvw7j'><center id='dvw7j'></center></pre></bdo></b><th id='dvw7j'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dvw7j'><tfoot id='dvw7j'></tfoot><dl id='dvw7j'><fieldset id='dvw7j'></fieldset></dl></div>
                    <tbody id='dvw7j'></tbody>
                  • <tfoot id='dvw7j'></tfoot>
                      <bdo id='dvw7j'></bdo><ul id='dvw7j'></ul>

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

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

                          主站蜘蛛池模板: 天堂一区二区三区 | 日韩国产精品一区二区三区 | 久久av一区二区三区 | 6080亚洲精品一区二区 | 欧美亚洲在线 | 蜜桃综合在线 | 99福利视频导航 | 男女羞羞在线观看 | 欧美在线一区二区视频 | 日韩视频在线播放 | 祝你幸福电影在线观看 | 日韩欧美在线一区 | 国产精品视频区 | 一区二区三区免费 | 成人不卡| 欧美日韩综合一区 | 狠狠干在线| 91就要激情| 在线观看成人av | 国产精品久久久av | 亚洲精品一区二三区不卡 | 国产日韩欧美在线观看 | 亚洲乱码一区二区 | 国产成人精品久久二区二区 | 精品国产视频 | 亚洲一区二区免费视频 | 我想看一级黄色毛片 | 国产福利91精品一区二区三区 | 日韩精品二区 | 亚洲精品电影在线 | 国产高清精品一区二区三区 | 全免费a级毛片免费看视频免 | 国产成人精品免费视频 | 91麻豆精品国产91久久久更新资源速度超快 | 精品少妇一区二区三区在线播放 | 国产精品无 | 日韩在线 | a国产一区二区免费入口 | 密色视频| 日韩免费中文字幕 | 波多野结衣一区二区 |