The usage of the ThinkPHP template comparison label is described in detail. The ThinkPHP template engine provides a wide range of comparison labels. the usage format is as follows: compare the value content of the variable value of the tag name. the comparison tag supported by the tag ThinkPHP system and the template engine of ThinkPHP provide a wide range of comparison tags. the usage format is as follows:
<比较标签 name="变量" value="值">
Content
The comparison labels supported by ThinkPHP and their meanings are as follows:
Eq or equal: equal
Neq or notequal: not equal
Gt: greater
Egt: greater than or equal
Lt: less
Elt: less than or equal
Heq: constant equals
Nheq: non-constant equals
1. the usage of comparison labels is basically the same. The difference is that the judgment conditions are different..
For example, eq labels:
value
Indicates that the value of the name variable is equal to the value and is output.
Or you can write it as follows:
value
It can also be used in combination with else labels.Such:
Equal
Not Equal
The gt label is as follows:
value
Indicates output when the value of the name variable is greater than 5.
The egt label is as follows:
value
Indicates output when the value of the name variable is no less than 5
2. the variables in the comparison Tag can support object attributes or arrays, or even System variables.:
An example of the eq tag is as follows:
{$vo.name}
Indicates that when the vo object attribute (or array, or automatic judgment) is 5, the output is
{$vo.name}
Indicates that when the vo object property is equal to 5, the output is
{$vo.name}
Indicates that when $ vo ['name'] is equal to 5, the output is
3. you can also use functions for variables.
For example:
{$vo.name}
Indicates that when the string length of the vo object's attribute value is equal to 5, the output is
4. variable names support system variables.For example:
Equal
Not Equal
5. Generally, the value of the compare tag is a string or number. to use a variable, you only need to add the "$" sign in front of it..
For example:
{$vo.name}
It indicates that when the vo object property is equal to $ a, the output is
6. all comparison labels can use the compare label.(In fact, all the comparison labels are the alias of the compare label), for example:
value
Indicates the output when the value of the name variable is equal to 5.
Equivalent
value
The value of the type attribute is the name of the comparison label listed above.
Comparison label name = "variable" value = "value" content/comparison label the comparison label supported by ThinkPHP and its representation...