|
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 |
byargv Smarty n00b
Joined: 17 Nov 2015 Posts: 2
|
Posted: Tue Nov 17, 2015 6:24 am Post subject: A foreach key bug |
|
|
Code: |
session_start();
$smarty()->assign(array(
'list' => array('3'=>3,'4'=>4),
));
$smarty()->display('demo.html');
|
Code: |
{foreach from=$list item=i key=sid}
{$i}:{$sid}<br />
{/foreach}
|
why when the key is sid,it not show? Smarty version 3.1.27 |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Nov 17, 2015 9:08 am Post subject: |
|
|
Code: | {foreach $list as $i}
{$i}:{$i@key}<br />
{/foreach} |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
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
|