<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                > ## 獲得請求對象 ``` // 方?法一:實例化對象 1.use think\Request; 2.$request = Request::instance(); // 方法?二: 助手函數 $request = request(); // 方法三:依賴注入 1.use think\Request; 2.在方法的形參表添加Request $request ``` >## 獲取URL信息 ``` $request = Request::instance(); // 獲取當前域名 echo 'domain: ' . $request->domain() . '<br/>'; // http://tp5.com // 獲取當前入口文件 echo 'file: ' . $request->baseFile() . '<br/>'; // /index.php // 獲取當前URL地址 不含域名 echo 'url: ' . $request->url() . '<br/>'; // /index/index/hello.html?name=thinkphp // 獲取包含域名的完整URL地址 echo 'url with domain: ' . $request->url(true) . '<br/>'; // http://tp5.com/index/index/hello.html?name=thinkphp // 獲取當前URL地址 不含QUERY_STRING echo 'url without query: ' . $request->baseUrl() . '<br/>'; // /index/index/hello.html // 獲取URL訪問的ROOT地址 echo 'root:' . $request->root() . '<br/>'; // // 獲取URL訪問的ROOT地址 echo 'root with domain: ' . $request->root(true) . '<br/>'; // http://tp5.com // 獲取URL地址中的PATH_INFO信息 echo 'pathinfo: ' . $request->pathinfo() . '<br/>'; // index/index/hello.html // 獲取URL地址中的PATH_INFO信息 不含后綴 echo 'pathinfo: ' . $request->path() . '<br/>'; // index/index/hello // 獲取URL地址中的后綴信息 echo 'ext: ' . $request->ext() . '<br/>'; // html ``` >## 獲取或設置 模塊/控制器/操作 ``` // 獲取 $request = Request::instance(); echo "當前模塊名稱是" . $request->module(); echo "當前控制器名稱是" . $request->controller(); echo "當前操作名稱是" . $request->action(); // 設置 Request::instance()->module('module_name') ``` >## 獲取請求參數 ``` $request = Request::instance(); echo '請求方法:' . $request->method() . '<br/>'; // GET echo '資源類型:' . $request->type() . '<br/>'; // html echo '訪問ip地址:' . $request->ip() . '<br/>'; // 127.0.0.1 echo '是否AJax請求:' . var_export($request->isAjax(), true) . '<br/>'; // false echo '請求參數:'; dump($request->param()); // array (size=2) 'test' => string 'ddd' (length=3) 'name' => string 'thinkphp' (length=8) echo '請求參數:僅包含name'; dump($request->only(['name'])); // array (size=1) 'name' => string 'thinkphp' (length=8) echo '請求參數:排除name'; dump($request->except(['name'])); // array (size=1) 'test' => string 'ddd' (length=3) ``` >## 獲取路由和調度信息 ``` $request = Request::instance(); dump($request->route()); // 路由信息 dump($request->dispatch()); // 調度信息 // 假設路?由定義 return [ 'hello/:name' =>['index/hello',[],['name'=>'\w+']], ]; // 假設訪問的url為 http://serverName/hello/thinkphp // 結果 路由信息: array (size=4) 'rule' => string 'hello/:name' (length=11) 'route' => string 'index/hello' (length=11) 'pattern' => array (size=1) 'name' => string '\w+' (length=3) 'option' => array (size=0) empty 調度信息: array (size=2) 'type' => string 'module' (length=6) 'module' => array (size=3) 0 => null 1 => string 'index' (length=5) 2 => string 'hello' (length=5) ``` >## 設置請求信息 ``` $request = Request::instance(); $request->root('index.php'); $request->pathinfo('index/index/hello'); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看