This article mainly introduced the thinkphp template arithmetic operation correlation function usage, has analyzed the thinkphp about the arithmetic operation and the parameter transfer the correlation skill, needs the friend can refer to the next
In this paper, we describe the usage of thinkphp template arithmetic operation correlation function. Share to everyone for your reference, as follows:
The function is defined as follows:
function You ($num 1,num2) { echo $num 1* $num 2/100;}
<volist name= "list" id= "Vo" > <tr><td>{$vo. price|you= $vo. Discount '}</td> or: {$vo. price*$ VO.DISCOUNT/100} </tr></volist>
The parameters that are received as write-on are array.discount. The required operation has no correct result.
Modified the code:
<td>{$vo. price|you= $vo [' Discount ']}</td><td>{$vo [' Price ']* $vo [' Discount ']/100}</td>
Both of these methods are available, so you can see that the thinkphp template does not support arithmetic operations and parameter passing of the object pattern.