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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ### 實戰部分 部署后臺靜態頁面模板及后臺登錄頁面 * 前言 * 一、部署靜態資源到項目 * * 1.新建后臺靜態資源文件夾 * 二、后臺登錄頁面 * * 1\. 目錄結構 * 2\. 模板字符串替換配置 * * * # 前言 網站后臺一般是在基礎靜態頁面上開發,將靜態頁面插入動態數據,首先我們先找一個后臺網站模板,這里我使用的是`layuiAdmin 后臺管理模板`,點擊進入官網 ,這個框架是需要收費的,請購買正版商用。 # 一、部署靜態資源到項目 ## 1.新建后臺靜態資源文件夾 在`public/static`目錄下新建`admin`文件夾,將`layuiAdmin`的`dist`目錄里的文件復制進來: ![在這里插入圖片描述](https://img-blog.csdnimg.cn/20201202224504211.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3p5MTI4MTUzOTYyNg==,size_16,color_FFFFFF,t_70) 訪問主頁嘗鮮:`http://tp6.com/static/admin/views/index.html` ![在這里插入圖片描述](https://img-blog.csdnimg.cn/20201202224647829.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3p5MTI4MTUzOTYyNg==,size_16,color_FFFFFF,t_70) # 二、后臺登錄頁面 ## 1\. 目錄結構 ![在這里插入圖片描述](https://img-blog.csdnimg.cn/20201202231750483.png) Login 控制器: ~~~php <?phpnamespace app\admin\controller; use app\BaseController; use think\facade\View;class Login extends BaseController {public function index(){return View::fetch('index');} } ~~~ ## 2\. 模板字符串替換配置 修改在`config`文件夾下的`view.php`文件,新增字符串替換配置: ~~~php 'tpl_replace_string' => ['{__STATIC__}' => '/static/' ], ~~~ 上面配置表示在`模板引擎`中會將`{__STATIC__}`替換為`/static/`,使用模板字符串替換的功能主要是為了維護方便,可以方便一次配置所有靜態文件的路徑,而不用為了寫多少個`../`而發愁。將login.html的內容復制到模板login的頁面: 原來登錄頁面引用靜態文件路徑: ~~~html <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all"> <link rel="stylesheet" href="../../layuiadmin/style/login.css" media="all"> ~~~ 修改為: ~~~html <link rel="stylesheet" href="{__STATIC__}/admin/layuiadmin/layui/css/layui.css" media="all"> <link rel="stylesheet" href="{__STATIC__}/admin/layuiadmin/style/admin.css" media="all"> <link rel="stylesheet" href="{__STATIC__}/admin/layuiadmin/style/login.css" media="all"> ~~~ > 如果訪問出現使用模板`報驅動錯誤Driver [Think] not supported.`,原因是`tp6`默認只能支持`PHP`原生模板,但配置文件`config/view.php`配置使用的卻是`Think`。 > 解決辦法: > > 1. 使用tp模板進行think-view安裝 > `composer require topthink/think-view` > 2. 使用原生模板 > 到配置文件`config/view.php`里把`'type' => 'Think'`修改為`'type' => 'php'` > 3. 使用原生模板 > `return View::engine('php')->fetch(“index”);` 登錄頁面訪問:`http://tp6.com/admin/login/index` ![在這里插入圖片描述](https://img-blog.csdnimg.cn/20201202232320201.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3p5MTI4MTUzOTYyNg==,size_16,color_FFFFFF,t_70) * * * ??重磅推薦:**免費商用電商系統** ??想白嫖整個電商系統用來商用? ??想有自己的商城實現財富自由?
                  <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>

                              哎呀哎呀视频在线观看