![]() |
vb:if condition problem
Hello all,
Does anybody knows what's wrong with: Code:
<vb:if condition="{vb:raw item_premium}==1">checked</vb:if> Maria |
Code:
<vb:if condition="$item_premium =='1'">CHECKED</vb:if> don't forget to register $item_premium. |
Quote:
Merry Christmas to you and to your family Maria |
Quote:
|
Quote:
Also, the first option would check if $item_premium is equal to the string 1, whereas the second would check if $item_premium is equal to the boolean 1 (i.e. "true"). |
Quote:
|
I've managed to use 2 equals signs for boolean in the past via PHP.
I'm not sure about conditions, but I've used it in PHP before. |
It would match booleans yes but it would also match the string or number representation. == in PHP is non type specific. i.e. it looks for values that match without checking the types. You use === if you want to make sure the type is the same as well i.e. both sides of the conditional are boolean or numerical etc. So if you wanted to make sure that something was true but not the number 1 or '1' then you'd need to do: if ($condition === true) because if you just had == then it would match with '1' or 1 too.
I barely ever need to check that the type matches as well but I thought it best to point that out. |
All times are GMT. The time now is 07:13 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|