Home > Article > Backend Development > How to import CSS and JS files into ThinkPHP templates, _PHP tutorial
The example in this article describes how to import CSS and JS files into ThinkPHP templates. Share it with everyone for your reference. The specific method is as follows:
Common methods
1. css uses link
2. js uses src
Use tp’s own import tag import
Import the test.js file in the Js directory under the Public folder. The type attribute can be omitted in the import tag. The default is the js file
Not in Public:
Other is not followed by / in the path
Use load tag
load tag, very simple, automatically detected
I hope this article will be helpful to everyone’s ThinkPHP framework programming.