The first is the import tag. The import method adopts the namespace method similar to the import function of ThinkPHP, for example:
Import tag (use namespace to introduce resource files) |
Close |
Close tags |
Attribute |
File (required): The resource file to be introduced. variables are supported. Type (optional): type of the introduced resource file. The default value is js. js css and php are supported. Basepath (optional): basic path of the namespace |
Example:
<Import type = 'js' file = "js. Util. Array"/>
The default Type attribute is js, so the following effects are the same:
<Import file = "Js. Util. Array"/>
You can also import multiple files in batches, for example:
<Import file = "Js. Util. Array, Js. Util. Date"/>
To import an external CSS file, you must specify the value of the type attribute. For example:
<Import type = 'css 'file = "css. common"/>
In the above method, the default import start path is the Public directory of the website. to specify other directories, you can use the basepath attribute, for example:
<Import file = "Js. Util. Array" basepath = "./Common"/>
The second is the load tag, which imports the public JS or CSS of the current project through the file method.
Load tag (use url to introduce resource files) |
Close |
Close tags |
Attribute |
Href (required): url address of the resource file to be introduced. variables are supported. |
For example:
<Load href = "../Public/Js/Common. js"/>
<Load href = "../Public/Css/common.css"/>
You can replace the href attribute with a special template tag, for example:
<Load href = "_ PUBLIC _/Js/Common. js"/>
You do not need to specify the type attribute for the Load tag. The system automatically determines the type based on the suffix.
The system also provides two label aliases. js and css are used in the same way as load. For example:
<Js href = "_ PUBLIC _/Js/Common. js"/>
<Css href = "../Public/Css/common.css"/>