<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 功能強大 支持多語言、二開方便! 廣告
                官方文檔 >系統會默認加載下面三個語言包: > 框架語言包: thinkphp\lang\當前語言.php > 應用語言包: application\lang\當前語言.php > 模塊語言包: application\模塊\lang\當前語言.php >如果要在模板中輸出語言變量不需要在控制器中賦值,可以直接使用模板引擎特殊標簽來直接輸出語言定義的值: >{$Think.lang.lang_var} 可以輸出當前語言包里面定義的 lang_var語言定義。 配置 ~~~ 'lang_switch_on' => true, ~~~ ![](https://box.kancloud.cn/5b7b3c42f469ad2c3bfec3d2fbac5074_493x502.png) zh-cn.php ~~~ <?php return [ 'tt' => '文章目錄' ]; ~~~ en-us.php ~~~ <?php return [ 'tt' => 'Article Category' ]; ~~~ application\admin\controller\Login.php ~~~ public function index() { $ttt = Lang::get('tt');//Controller中如何調用多語言,也可以用lang('tt') 簡寫 // cookie('think_var', 'en-us'); //英 cookie('think_var', 'zh-cn'); //中 $this->assign('ttt', $ttt); return $this->fetch(); } ~~~ \application\admin\view\login\index.html ~~~ 1---{$Think.lang.tt}--第一種調用方法 2---{:lang('tt')}--與第一種方法一樣 3---{$ttt}--controller中調用Lang類 ~~~ 總結:從上面的代碼中我們可以得知,tp5多語言其實是讀取cookie,然后去不同的語言包取數據,有兩種形式可以取到,一個是從Controller取,一個是從模板中直接取,不管哪一種,都實現了數據與語言選擇的分離。
                  <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>

                              哎呀哎呀视频在线观看