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

how to solve it?

 
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
joey
Smarty Regular


Joined: 29 Oct 2003
Posts: 57

PostPosted: Thu Nov 06, 2003 7:31 am    Post subject: how to solve it? Reply with quote

$mylist and $status both are array.

$status[0] = "activate" ;
$status[1] = "deactivate";

$mylist are the result of mysql sql query

how to process two "[" ,like that: {$status[$mylist[row].status]}

Code:
 {section name=row loop=$mylist}
        <tr>
          <td height="23"><div align="center">{$mylist[row].pnameCN}</div></td>
          <td><div align="center">{$status[$mylist[row].status]}</div></td>
        </tr>
      {/section}
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
livingdead
Smarty Rookie


Joined: 08 Oct 2003
Posts: 9

PostPosted: Wed Nov 12, 2003 1:14 pm    Post subject: Same problem Reply with quote

I got the same difficulty could you help please

Livingdead
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Nov 12, 2003 1:59 pm    Post subject: Re: how to solve it? Reply with quote

you cannot use these values directly (unfortunately) so you have to assign an intermediate value:

Code:
 {section name=row loop=$mylist}
{assign var=status_value value=$mylist[row].status}
        <tr>
          <td height="23"><div align="center">{$mylist[row].pnameCN}</div></td>
          <td><div align="center">{$status.$status_value}</div></td>
        </tr>
      {/section}
Back to top
View user's profile Send private message Send e-mail 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 -> 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