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

2 variables in a section/for else

 
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 -> General
View previous topic :: View next topic  
Author Message
guido
Smarty Rookie


Joined: 02 May 2003
Posts: 9

PostPosted: Fri Jul 11, 2003 7:25 pm    Post subject: 2 variables in a section/for else Reply with quote

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
View user's profile Send private message
Enquest
Smarty Regular


Joined: 14 May 2003
Posts: 79

PostPosted: Sat Jul 12, 2003 12:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
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 -> General 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