This article mainly introduces how to import CSS and JS files in the ThinkPHP template, and analyzes the tips for using the import label and load label to import css and js files, for more information about how to import CSS and JS files in the ThinkPHP template, see the examples in this article. Share it with you for your reference. The specific method is as follows:
Common methods
1. css uses link
2. js uses src
Use the import tag of tp
Import the test. Js file in the js directory under the Public folder. the import label can omit the type attribute. the default value is the js file.
The code is as follows:
Not Public:
The code is as follows:
Other is not followed by/in the path/
Use the load label
Load label, very simple, automatic detection
The code is as follows:
I hope this article will help you with ThinkPHP framework programming.