Thinkphp5筆記五:配置data檔案夾

來源:互聯網
上載者:User

標籤:runtime   nbsp   css   png   div   r.js   color   bootstrap   config   

如果你看項目下的各種檔案,有種亂七八糟的感覺的話,你就可以進行以下配置。

配置data檔案夾的,整理各種檔案,讓看起來舒服些。

 

一、設定runtime檔案夾

index.php

define(‘RUNTIME_PATH‘, __DIR__ . ‘/data/runtime/‘);

 

二、設定upload,存放上傳圖片、上傳檔案

三、設定static,存放jquery.js、bootstrap、一些效果外掛程式什麼的

// 視圖輸出字串內容替換‘view_replace_str‘       => [    ‘__DATA__‘ => SITE_PATH.‘data/‘,    // 上傳檔案路徑    ‘__UPLOAD__‘ =>SITE_PATH.‘data/upload/‘,    //  靜態檔案路徑 (如bootshop,js,css)    ‘__STATIC__‘ =>SITE_PATH.‘data/upload/‘,    ],

四、定義模板檔案路徑,方便調用模板下的css、js、images

‘view_replace_str‘       => [    // 模板檔案路徑    ‘__TEMPLATE__‘ => config(‘template.view_path‘).config(‘index.model_name‘).‘/‘.config(‘index.default_template‘).‘/‘,    // 模板下的共用檔案路徑(css,js,images...)    ‘__PUBLIC__‘ => SITE_PATH.‘/‘.config(‘template.view_path‘).config(‘index.model_name‘).‘/‘.config(‘index.default_template‘).‘/public/‘,],

模板頁引用:

<script src=__PUBLIC__js/jqueyr.js”><link href=”__PUBLIC__css/style.css”>
<img src="__PUBLIC__images/1.png">

五、想放什麼都可以,自己設定

Thinkphp5筆記五:配置data檔案夾

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.