This article mainly introduces the usage of thinkphp special labels, and analyzes the usage of tags such as in, between, present, and Empty, which has some reference value, for more information about the ThinkPHP special tag usage, see the example in this article. Share it with you for your reference. The specific analysis is as follows:
Special labels:
1. compare tags
Equal to eq or equal
Neq or notequal is not equal
Gt>
Egt greater than or equal
Lt is less
Elt less than or equal
Heq constant equals
Nheq is not always equal
2. range tag
In
The code is as follows:
In these numbers Not within the range of these numbers
In these numbers Not within the range of these numbers
Between
The code is as follows:
Between {$ n} and 1-10 {$ N} is not between 1 and 10.
3. present
Label to determine whether the template variable has been assigned a value
The code is as follows:
M has a value assignment. M is not assigned a value.
4. Empty
Empty tag determines whether the template variable is empty
The code is as follows:
N is null N value
5. Defined
Determine whether a constant has been defined
6. Define
Define constants in the template
7. Assing
Variable assignment in the template
Other labels:
1. directly use PHP code in the template
The code is as follows:
Echo "this is my home"
2. it is recommended to change the left and right delimiters.
Change in configuration file
The code is as follows:
'Tmpl _ L_DELIM '=>' <{', // modify the left delimiter
'Tmpl _ R_DELIM '=>'}> ', // modify the right delimiter
I hope this article will help you with ThinkPHP framework programming.