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

array syntax problem (small prob)

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


Joined: 14 May 2003
Posts: 79

PostPosted: Wed Jun 11, 2003 7:26 pm    Post subject: array syntax problem (small prob) Reply with quote

I got the following array that I want to display correct in a html_option
Somehow I don't get the right syntax. Whats wrong.

the Array is
Code:

Array ( [id] => 22 [id_plan] => 14 [action] => test [comment] => test [begindate] => 2003-06-11 [enddate] => 2003-06-11 [who] => Array ( [0] => admin [1] => William [2] => luc  [3] => tom [4] => Richard [5] => Maya  ) [tstamp] => 20030611210253 )


How do I display the who array. Note that this is all in a section.
Code:

{section name=act loop=$action}
<tr bgcolor="{cycle values="#fcffe9,#ffefef"}">
 ...
   <td><select>{html_options name=who option=$action[act].who}</select></td>
...
{/section}


The option box is always empty what ever syntax I try.
_________________
-----------------------
Learning my self by trying to help others
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Wed Jun 11, 2003 8:27 pm    Post subject: Reply with quote

two things:

if you provide a "name"-attribute to html_options the plugin itself prints the <select> tag, so you don't have to put it into your section or you will end up in two nested <select>s.

the attribute is called "options" not "option" as in your example. maybe this is the source of all your trouble.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Enquest
Smarty Regular


Joined: 14 May 2003
Posts: 79

PostPosted: Wed Jun 11, 2003 8:41 pm    Post subject: Reply with quote

And I spend at least one hour looking at the syntaxs. Making sure that I didn't mis anything. And what is it a typo.
Any very much thanxs...
_________________
-----------------------
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