In the html in thinkphp
I want to determine whether $huodong.id and $vo.xueduanid are equal.
xueduanid:{$vo.xueduanid}huodongid:{$huodong.id}
Output xueduanid:1huodongid:1
<if condition="$vo.xueduanid == $huodong.id">eee</if>
But eee cannot be output like this. Why? They are all 1. They should be equal? Wrong type? The values in the database are all int types. .
<if condition="$vo.xueduanid == 1">eee</if>can output eee
<if condition="$huodong.id==1">eee</if> ;can output eee
== changed to eq
Use directly
eq
<if condition="$vo.xueduanid eq $huodong.id">
equal
<else/>
not equal
</if>
Actually, TP’s template engine has a bit of a bug. The above is theoretically correct, but in fact it has to be written as
The latter variable must be written in array form, otherwise an error will occur when converting it into PHP code.