|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
pvdb Smarty Rookie
Joined: 07 Mar 2014 Posts: 6
|
Posted: Fri May 27, 2016 12:53 pm Post subject: Bug inside if query |
|
|
Hi Guys,
In my template I had a code like:
{if $value.selected == $counter2 }selected{/if}
When $value.selected and $counter2 were numbers, everything works fine.
But for $value.selected = 0 and $counter2 = top1234 it did not work. smarty says 0 is equal to top1234.
As I changed top1234 into 1234top smarty says it is unequal.
I think there should be a little bug or little magic.
Best regards |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri May 27, 2016 1:37 pm Post subject: |
|
|
This is nothing unexpected, and this is how PHP works.
You will get the same result without Smarty, in pure PHP code. |
|
Back to top |
|
pvdb Smarty Rookie
Joined: 07 Mar 2014 Posts: 6
|
Posted: Fri May 27, 2016 1:41 pm Post subject: |
|
|
Thanks for the feedback.
I did not know that.
Never had such a problem with PHP during the last years. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|