|
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 |
skycyclone Smarty Rookie
Joined: 18 Dec 2009 Posts: 5
|
Posted: Fri Dec 18, 2009 6:25 am Post subject: bug for smarty3?~ |
|
|
Code: | {[assign var=foo value="|"|explode:$list[list].other]}
{[foreach from=$foo item=foo]}
<input type="radio" name="text{[$list[list].id]}" value="{[$foo]}" id="text{[$smarty.section.list.index]}">
{[$foo]}
{[/foreach]} |
Smarty2.x of this code can function properly, but does not work correctly on Smarty3.0,not error messages,Smarty3.0 not "explode" feature?help~~~~~ |
|
Back to top |
|
skycyclone Smarty Rookie
Joined: 18 Dec 2009 Posts: 5
|
Posted: Fri Dec 18, 2009 8:10 am Post subject: I found the cause of the problem of |
|
|
Code: | {[assign var=foo value="|"|explode:$list[list].other]}
{[foreach from=$foo item=item name=foo]}
<input type="radio" name="text{[$list[list].id]}" value="{[$item]}" id="text{[$smarty.section.list.index]}">
{[$item]}
{[/foreach]} |
On smarty3 "foreach" $+"item" != "from" |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Dec 18, 2009 3:02 pm Post subject: |
|
|
Code: | {[foreach from=$foo item=foo]} |
Don't use the same variable name as the var being looped. |
|
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
|