Home  >  Article  >  PHP Framework  >  How to configure css path in thinkphp

How to configure css path in thinkphp

步履不停
步履不停Original
2019-06-20 14:30:495709browse

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,

5e63ffe8d590d4d6b82f049231eec044

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

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