Home > PHP Framework > ThinkPHP > body text

How to configure css path in thinkphp

步履不停
Release: 2019-06-20 14:30:49
Original
5667 people have browsed it

How to configure css path in thinkphp

When using the template of thinkphp5, you can directly place the css and other effect files that need to be introduced in the corresponding directory under /public/static/. When using the template file, you can directly,

<link href="/static/admin/css/style.min.css?v=4.1.0" rel="stylesheet">

Or

{load file="/static/admin/css/bootstrap.css"} and other methods are introduced, but if the directory where these files are located is changed, in the code There will be a lot of changes in the general.

Here you can directly add <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">//模板引入js,css,img路径常量设置 &amp;#39;view_replace_str&amp;#39; =&gt; [ &amp;#39;__CSS__&amp;#39; =&gt;&amp;#39;/static/admin/css&amp;#39;, &amp;#39;__JS__&amp;#39; =&gt;&amp;#39;/static/admin/js&amp;#39;, &amp;#39;__IMG__&amp;#39; =&gt;&amp;#39;/static/admin/img&amp;#39;, &amp;#39;__FONT__&amp;#39; =&gt;&amp;#39;/static/admin/img&amp;#39;, ]`</pre><div class="contentsignin">Copy after login</div></div> in the config.php file under the application configuration file (

/application/admin

). It is not recommended to add Modify the project framework configuration file (/application), so that the js and css constants that need to be loaded by different applications (admin, home) can be included module path.

For more ThinkPHP related technical articles, please visit the ThinkPHP usage tutorial column to learn!

The above is the detailed content of How to configure css path in thinkphp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!