|
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 |
exac Smarty n00b
Joined: 26 Mar 2015 Posts: 1
|
Posted: Thu Mar 26, 2015 11:23 pm Post subject: Problems with multiple digit values |
|
|
Hello!
I have a strange problem with a small script I made with smarty:
Code: |
{assign var=r value=$rescomplex|count-1}
{while $r >= 0}
{foreach from=$rescomplex[$r].rescomplex_id}
{if $developers.developers_id.value==$rescomplex[$r].dev_id.value}
{$rescomplex[$r].dev_id.value}
some html stuff here
{/if}
{/foreach}
{assign var=r value=$r-1}
{/while}
|
It works fine while $developers.developers_id.value is less than 10. After that any more than single digit number turns into a single digit number: 10 becomes 1 (so does 11 to 19), 20 becomes 2, 535 becomes 5 etc.
Putting {$rescomplex[30].dev_id.value} with known value outside that loop produces the same result: it outputs only the first digit.
I've looked into {debug} results and they show that value there is full number as intended. I have no clue what am I doing wrong so I would be glad if someone could guide me.
TIA.
UPD: Well, that was stupid of me. All I had to do is not to use .value in "$rescomplex[$r].dev_id". I still don't know why it did truncate my precious ids but lesson learned: at least try to understand what you're doing.
Cheers. |
|
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
|