<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 頁面跳轉 操作完成后,成功或失敗頁面跳轉可以使用 控制器基類的success,error方法: #### success方法 ```php /** * 操作成功跳轉的快捷方法 * @access protected * @param mixed $msg 提示信息 * @param string $url 跳轉的URL地址 * @param mixed $data 返回的數據 * @param integer $wait 跳轉等待時間 * @param array $header 發送的Header信息 * @return void */ protected function success($msg = '', $url = null, $data = '', $wait = 3, array $header = []) ``` 常用方式: ```php //默認跳轉到$_SERVER['HTTP_REFERER'] $this->success('添加成功'); //默認跳轉到article/index $this->success('添加成功',url('article/index')); //默認跳轉到article/index,并設置數據 $this->success('添加成功',url('article/index'),['id'=>1]); ``` #### error方法 ```php /** * 操作錯誤跳轉的快捷方法 * @access protected * @param mixed $msg 提示信息 * @param string $url 跳轉的URL地址 * @param mixed $data 返回的數據 * @param integer $wait 跳轉等待時間 * @param array $header 發送的Header信息 * @return void */ protected function error($msg = '', $url = null, $data = '', $wait = 3, array $header = []) ``` 常用方式: ```php //默認跳轉到javascript:history.back(-1); $this->error('添加失敗'); //默認跳轉到article/index $this->error('添加失敗',url('article/index')); //默認跳轉到article/index,并設置數據 $this->error('添加失敗',url('article/index'),['id'=>1]); ``` ## AJAX返回 和上面的頁面跳轉類似也使用 success,error方法,只是如果是 ajax請求會以 json格式返回 #### success方法 常用方式: ```php //默認跳轉到$_SERVER['HTTP_REFERER'] $this->success('添加成功'); //默認跳轉到article/index $this->success('添加成功',url('article/index')); //默認跳轉到article/index,并設置數據 $this->success('添加成功',url('article/index'),['id'=>1]); ``` 返回結果: ``` { "code":1, "msg":"添加成功!", "data":"", "url":"", "wait":3 } ``` #### error方法 常用方式: ```php //默認跳轉到javascript:history.back(-1); $this->error('添加失敗'); //默認跳轉到article/index $this->error('添加失敗',url('article/index')); //默認跳轉到article/index,并設置數據 $this->error('添加失敗',url('article/index'),['id'=>1]); ``` 返回結果: ``` { "code":0, "msg":"添加失敗!", "data":"", "url":"", "wait":3 } ``` ## 重定向 重定向用控制器的 redirect 方法 ``` /** * URL重定向 * @access protected * @param string $url 跳轉的URL表達式 * @param array|integer $params 其它URL參數 * @param integer $code http code * @return void */ protected function redirect($url, $params = [], $code = 302) ``` 常用方式: redirect方法的參數用法和助手函數url的用法一致(參考URL生成部分),如: ``` $this->redirect('Article/index', ['id' => 2]); ``` 重定向到指定的外部URL地址 并且使用302 ``` $this->redirect('http://www.thinkcmf.com',302); ```
                  <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>

                              哎呀哎呀视频在线观看