<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                #### G.url方法 模版引擎生成url方法 模版標簽調用方法: ~~~ {% set id = '1' %} {{ G.url('app/index/index',{'id':id})}} ~~~ 普通模式下輸出: ~~~ http://test.calfbb.com/index.php?m=app&c=index&a=index&id=1 ~~~ 偽靜態模式下輸出 ~~~ http://test.calfbb.com/index.php/app/index/index/id/1.html ~~~ js調用方法 ~~~ va testid=1; var url="{{ G.url('app/index/index',{'id':'testid'})}}"; console.log(url); ~~~ 普通模式輸出 (偽靜態模式輸出跟上面一致) ~~~ http://test.calfbb.com/index.php?m=app&amp;c=index&amp;a=index&amp;id=testid ~~~ 注意:testid沒有被替換,原因是G.url是php函數不是js函數,testid是js變量,不是php變量,解決方法如下: ~~~ var testid=1; var url="{{ G.url('app/index/index',{'id':'testid'})}}"; url = url.replace("testid", testid);//使用js自帶函數進行變量替換 console.log(url); ~~~ 輸出: ~~~ http://test.calfbb.com//index.php?m=app&amp;c=index&amp;a=index&amp;id=1 ~~~ 最后再過濾掉轉義字符(如果有&amp字符出現的情況下) ~~~ var testid=1; var url="{{ G.url('app/index/index',{'id':'testid'})}}"; url = url.replace("testid", testid);//使用js自帶函數進行變量替換 console.log(escapeUrl(url)); /** * 字符轉義 * @param str */ function escapeUrl(str) { var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'}; return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];}); } ~~~ 輸出: ~~~ http://test.calfbb.com/index.php?m=app&c=index&a=index&id=1 ~~~
                  <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>

                              哎呀哎呀视频在线观看