Home  >  Article  >  Backend Development  >  How to import CSS and JS files into ThinkPHP templates, _PHP tutorial

How to import CSS and JS files into ThinkPHP templates, _PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:12:43825browse

How to import CSS and JS files into ThinkPHP template,

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

Copy code The code is as follows:

Not in Public:

Copy code The code is as follows:

Other is not followed by / in the path

Use load tag

load tag, very simple, automatically detected

Copy code The code is as follows:

I hope this article will be helpful to everyone’s ThinkPHP framework programming.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/919622.htmlTechArticleHow to import CSS and JS files into ThinkPHP templates. This article describes how to import CSS and JS files into ThinkPHP templates. method. Share it with everyone for your reference. The specific methods are as follows: Common methods...
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