|
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 |
Seven Smarty n00b
Joined: 18 Aug 2003 Posts: 1 Location: Romania
|
Posted: Mon Aug 18, 2003 11:57 am Post subject: html_table and html_options |
|
|
Hi
Is there a way to mix html_tables with html_options for example?
I need a way to dynamically generate a table and a form. I need an output like this:
<table>
<tr><td>aaa</td><td>bbb</td></tr>
<tr><td>ccc</td><td>ddd</td></tr>
<tr><td>Address</td><td><input type=text .....></td></tr>
<tr><td>Country</td><td>
<select name=country>
<option value=0>US</option>
<option value=1>UK</option>
.....
</select>
</td></tr>
<tr><td>xxx</td><td>yyy</td></tr>
<tr><td>zzz</td><td>www</td></tr>
<tr><td>ID</td><td>
<select name=id>
<option value=0>0</option>
<option value=1>1</option>
.....
</select>
</td></tr>
</table>
I want all this generated with html_* functions because before generation time I don't know how much rows i have in table to manually write a template.
I can generate a string for each TD and use only html_table but i whant to use html_options, html_radios becose i don't what to mess php code with html code and becose is easy to mantain.
10x
bye
bye |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Aug 18, 2003 1:57 pm Post subject: |
|
|
They can't be mixed, you'll have to build them manually. You'll still maintain your presentation separation in the template, just loop over your option arrays and build the HTML tables and form elements as you go.
It might be feasible to rewrite an html_options function that supports tables too... |
|
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
|