|
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 |
gordonisnz Smarty Regular
Joined: 05 Sep 2009 Posts: 70
|
Posted: Sun Mar 04, 2012 11:11 am Post subject: SECTION and arrays ? |
|
|
Hello.
I'm used to doing foreach routines in smarty, but now discovered the SECTION function, to display 2-column tables
Its easy enough.
However, I have an array
Data1
-Name=Bob
-Surname=Jones
-Region=USA
Data2
-Name=Jill
-Surname=Jacks
-Region=USA
Data3
-Name=John
-Surname=Jacks
-Region=Britain
Are there any examples / tutorials to do an IF command - Or using SECTION, to only display information if "Region" is USA ??
and then, to display $array[$loop][Name] - Or something, so i can display or not to display a variable ?
in a FOREACH loop, you have 'key' & 'item' which you can use to reference data, but i can't see in the examples I've found, how you use 'key' or 'item' equivalents in the section command.
Thank you |
|
Back to top |
|
gordonisnz Smarty Regular
Joined: 05 Sep 2009 Posts: 70
|
|
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
|