1
jmass
Help with array please
  • 2004/2/14 15:23

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


I need to make a list pulled from a MySQL table usable for options in a drop down box.

When I put the HTML in the class (I know it should not really be there) is pulls the data and formats is correctly. It then throws it at the top of my page, before the Smarty template kicks in.

When I try to pass the results to a Smarty variable and let the template handle the HTML, it generates "Array" on the HTML output.

I am sure that I am way off base in how I am trying to do this. This is my first module. Is there a good example of the proper way to do this?

Thanks,

JMass

2
Mithrandir
Re: Help with array please

There's a handy SMARTY function for generating select options.

<select name etc....>
<{
html_options values=$array selected=$value}>
</
select>

pass an array with value-name pairs ($array[1] => "something" will give <option value='1'>something</option>) and you should be all set.

3
jmass
Re: Help with array please
  • 2004/2/14 21:10

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


Thank you sooo much. It worked great!

Login

Who's Online

106 user(s) are online (71 user(s) are browsing Support Forums)


Members: 0


Guests: 106


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits