The switch label in the thinkphp template is used to output different values in the template according to different conditions.
The thinkphp template engine supports switch judgment and can output different results according to different conditions, using the following format:
Output content 1
output 2
default condition
Examples of usage are as follows:
Administrator
visitors
Note here:
The Name property can use a function as well as a system variable whose property value is a variable name, without a $ symbol, and a $ symbol is required when using a variable with value, as shown in the example above.
While value values in the case of the use of variables, no longer support the simultaneous judgment of multiple conditions , such as the following multi-conditional judgment.
Multi-Conditional judgment:
The Value property of case can support multiple conditions while judging, using | Symbol to split:
Image format File
Other format file
This means that if the value of $_get["type"] is GIF, PNG, or JPG, it is judged as an image format.
The Name property can also be a system variable, and you can use functions such as:
......
http://www.bkjia.com/PHPjc/824725.html www.bkjia.com true http://www.bkjia.com/PHPjc/824725.html techarticle the switch label in the thinkphp template is used to output different values in the template according to different conditions. thinkphp template engine supports switch judgment, can output different results according to different conditions, using ...