Get the App
SLTechnology News&Howtos  ›  Development  › 

An example of thinkphp configuring css path in php

Shulou Source: shulou.com Published: 2022-06-03 17:32:29 11月13日 Update

This article introduces the relevant knowledge of "an example of configuring css paths in thinkphp in php". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Description

1. In the template use of thinkphp5, you can directly place the effect files such as css that need to be introduced in the corresponding directory under / public/static/.

When using template files, it can be introduced directly, such as {load file= "/ static/admin/css/bootstrap.css"}. When changes are sent to the directory where these files are located, there will be a lot of changes in the code.

2. You can add it directly in the file of the application configuration (/ application/admin).

Example

/ / introduction of js,css,img path constant setting 'view_replace_str' = > [' _ _ CSS__' = >'/ static/admin/css','_ JS__' = >'/ static/admin/js','_ _ IMG__' = >'/ static/admin/img','_ FONT__' = >'/ static/admin/img',] `

It is not recommended to modify (/ application) in the project framework configuration file, so that different applications (admin,home) and so on need to load the js,css constant to include the module path.

This is the end of the content of "an example of configuring css paths in thinkphp in php". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: File path configuration instance template content constant more directory knowledge application different practical great successful next lieutenant general code dilemma place Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Huawei NVidia Linux MySQL