Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

foreach input array key...

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
dobs
Smarty Rookie


Joined: 29 Dec 2010
Posts: 25
Location: Kyiv / Ukraine

PostPosted: Fri Jan 14, 2011 1:57 am    Post subject: foreach input array key... Reply with quote

Hello, please add for foreach possibility to foreach by key like this
{foreach $blocks.header as $k=>$v}
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Jan 14, 2011 2:35 am    Post subject: Reply with quote

You can just like that in Smarty 3. For Smarty 2:

{foreach from=$foo key="key" item="item"}
Back to top
View user's profile Send private message Visit poster's website
dobs
Smarty Rookie


Joined: 29 Dec 2010
Posts: 25
Location: Kyiv / Ukraine

PostPosted: Fri Jan 14, 2011 8:26 am    Post subject: Reply with quote

Thanks, it work)
(I have error in my array...)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP