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

  • <small id='IgeWP'></small><noframes id='IgeWP'>

    <tfoot id='IgeWP'></tfoot>

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

        如何在 Zend Framework 2 中訪問路由、發布、獲取等

        How to access route, post, get etc. parameters in Zend Framework 2(如何在 Zend Framework 2 中訪問路由、發布、獲取等參數)

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

                  <tbody id='hpOl2'></tbody>
                <tfoot id='hpOl2'></tfoot>

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

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

                • 本文介紹了如何在 Zend Framework 2 中訪問路由、發布、獲取等參數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  如何在zf2中獲取與頁面請求相關的各種參數?像 post/get 參數、被訪問的路由、發送的標題和上傳的文件.

                  How can I get various parameters related to the page request in zf2? Like post/get parameters, the route being accessed, headers sent and files uploaded.

                  推薦答案

                  最簡單的方法是使用 Params 插件,在 beta5 中引入.它具有實用方法,可以輕松訪問不同類型的參數.與往常一樣,閱讀測試可以證明對于了解應該如何使用某物很有價值.

                  The easiest way to do that would be to use the Params plugin, introduced in beta5. It has utility methods to make it easy to access different types of parameters. As always, reading the tests can prove valuable to understand how something is supposed to be used.

                  要獲取控制器中命名參數的值,您需要為要查找的參數類型選擇適當的方法并傳入名稱.

                  To get the value of a named parameter in a controller, you will need to select the appropriate method for the type of parameter you are looking for and pass in the name.

                  $this->params()->fromPost('paramname');   // From POST
                  $this->params()->fromQuery('paramname');  // From GET
                  $this->params()->fromRoute('paramname');  // From RouteMatch
                  $this->params()->fromHeader('paramname'); // From header
                  $this->params()->fromFiles('paramname');  // From file being uploaded
                  

                  所有這些方法還支持默認值,如果沒有找到給定名稱的參數,將返回這些默認值.

                  All of these methods also support default values that will be returned if no parameter with the given name is found.

                  $orderBy = $this->params()->fromQuery('orderby', 'name');
                  

                  訪問 http://example.com/?orderby=birthdate 時,$orderBy 的值為 birthdate.
                  訪問 http://example.com/ 時,$orderBy 將具有 默認name.

                  When visiting http://example.com/?orderby=birthdate, $orderBy will have the value birthdate.
                  When visiting http://example.com/, $orderBy will have the default value name.
                  ?

                  要獲取一種類型的所有參數,只需不要傳入任何內容,Params 插件將返回一個以名稱為鍵的值數組.

                  To get all parameters of one type, just don't pass in anything and the Params plugin will return an array of values with their names as keys.

                  $allGetValues = $this->params()->fromQuery(); // empty method call
                  

                  訪問http://example.com/?orderby=birthdate&filter=hasphone時 $allGetValues 將是一個類似

                  array(
                      'orderby' => 'birthdate',
                      'filter'  => 'hasphone',
                  );
                  

                  如果您查看源代碼 對于 Params 插件,您將看到它只是其他控制器的薄包裝器,以允許更一致的參數檢索.如果您出于某種原因想要/需要直接訪問它們,您可以在源代碼中看到它是如何完成的.

                  If you check the source code for the Params plugin, you will see that it's just a thin wrapper around other controllers to allow for more consistent parameter retrieval. If you for some reason want/need to access them directly, you can see in the source code how it's done.

                  $this->getRequest()->getRequest('name', 'default');
                  $this->getEvent()->getRouteMatch()->getParam('name', 'default');
                  

                  注意:您可以使用超全局變量 $_GET、$_POST 等,但不鼓勵這樣做.

                  NOTE: You could have used the superglobals $_GET, $_POST etc., but that is discouraged.

                  這篇關于如何在 Zend Framework 2 中訪問路由、發布、獲取等參數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  enable SOAP on PHP(在 PHP 上啟用 SOAP)
                  Get received XML from PHP SOAP Server(從 PHP SOAP 服務器獲取接收到的 XML)
                  not a valid AllXsd value(不是有效的 AllXsd 值)
                  PHP SoapClient: SoapFault exception Could not connect to host(PHP SoapClient:SoapFault 異常無法連接到主機)
                  Implementation of P_SHA1 algorithm in PHP(PHP中P_SHA1算法的實現)
                  Sending a byte array from PHP to WCF(將字節數組從 PHP 發送到 WCF)

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

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

                            主站蜘蛛池模板: 一区二区成人 | 成人免费视频 | 亚洲成人一区 | 国产精品久久久久一区二区三区 | 日本在线免费视频 | 黄色大片视频 | 成人精品一区二区 | 国产精品1区2区3区 一区中文字幕 | 久久久亚洲一区 | 成人在线欧美 | 欧美激情在线精品一区二区三区 | 亚洲成人免费av | 欧美一级黄色片 | 国产精品久久久久久久久久免费看 | 国产丝袜一区二区三区免费视频 | 国产一区二区在线免费 | 欧区一欧区二欧区三免费 | 欧美激情在线一区二区三区 | 美美女高清毛片视频免费观看 | 午夜电影日韩 | 精品国产伦一区二区三区观看体验 | 日韩免费高清视频 | 天堂资源 | 国产精品视频在 | 国产一区二区在线视频 | 男女精品久久 | 中文字幕国产 | 日本xx视频免费观看 | 毛片99| 久久久久亚洲视频 | 一区二区三区四区视频 | 中文字幕一区二区三区精彩视频 | 欧美性猛交 | 激情欧美一区二区三区 | 亚洲欧美日韩中文字幕一区二区三区 | 国产三级电影网站 | 操亚洲 | 色综合一区 | 久久久精品一区二区三区 | 国产一区不卡 | 国产午夜在线 |