|
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 |
guido Smarty Rookie
Joined: 02 May 2003 Posts: 9
|
Posted: Fri Jul 11, 2003 7:25 pm Post subject: 2 variables in a section/for else |
|
|
I'm sure there is an answer in the forums somewhere, but i can't find, although i'll leep looking..
but what i'm trying to do is dynamically, call the values in a key..
so the data would be displayed:
[ section A] [ section B]
--- loop --
{section A value} {section B value}
but the A and the B would be unknown, and created on the fly..
the code i've tried is here:
array is = '0' => [head] => sectA, '1' => [head] => sectB,
while the items would come through normally as: $items[x].sectA and $items[x].sectB .. but the part after the "." is variable and not known..
Code: |
{section name='x' loop=$items}
{section name="headers" loop=$pref_show_in}
{assign var="showitem" value="`$items[x]`.`$pref_show_in[headers].head`"}
{$showitem}
{/section}
{/section}
|
any help would be appreciated... _________________ read docs .. read 'em .. uh oh i'm dumb |
|
Back to top |
|
Enquest Smarty Regular
Joined: 14 May 2003 Posts: 79
|
Posted: Sat Jul 12, 2003 12:43 pm Post subject: |
|
|
Could you explain it in more detail I don't think I understand your question. Could be me...
Maybe you simple need to flip your array (flip_array) in PHP. _________________ -----------------------
Learning my self by trying to help others |
|
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
|