![Smarty Forum Index Smarty Forum Index](templates/smarty/images/phpbb2_logo.gif) |
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 |
Borgtex Smarty Rookie
Joined: 28 Mar 2011 Posts: 9
|
Posted: Tue Jul 17, 2012 10:00 am Post subject: Surround each label of html_checkboxes with a custom tag |
|
|
As the separator option did'nt gives the flexibility I need to apply css styles, I've added a new option "tag" to the html_radios and html_checkboxes functions to surround each label with whatever tag you want, i.e.:
{html_checkboxes name='id' options=$cust_checkboxes selected=$customer_id tag='li'}
would produce
<li><label><input type="checkbox" name="id[]" value="1000" />Joe Schmoe</label></li>
<li><label><input type="checkbox" name="id[]" value="1001" checked="checked" />Jack Smith</label></li>
I know you can do the same assigning the result of html_checkboxes to an array and then looping through it, but it's less intuitive and with more amount of code, so I was wondering if this could be added to the official release |
|
Back to top |
|
rodneyrehm Administrator
![](images/avatars/18922434164ec3cfa3e63f8.jpg)
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Tue Jul 17, 2012 11:31 am Post subject: |
|
|
Maybe something along the lines of {… wrap="<li>%s</li>"} is more flexible? _________________ Twitter |
|
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
|