html_checkboxes() feature request?
| From: | Kevin Carlson | Date: | Sun, 14 Aug 2005 03:24:49 +0000 |
| Subject: | html_checkboxes() feature request? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12963@lists.php.net to get a copy of this message | ||
Hi,
I have a question regarding the html_checkboxes() plugin/function. I
have it working fine, but wanted to assign CSS classes to each checkbox.
If I can get the internal iteration number of the function somehow, I
could do this.
html_checkboxes() example:
<li>
{html_checkboxes name=admin_checkboxes options=$this->admin_checkboxes
selected=$this->admin_checkboxes_selected separator="</li>\n<li class=
$this->admin_checkboxes_class[NO_KEY_TO_USE]" }
</li>
much longer example, just using smarty's foreach()"
{foreach from=$this->admin_checkboxes key=key item=item }
<li class="{$this->admin_checkboxes_class[$key]}">
<label>
<input type="checkbox" name="admin_checkboxes[]"
value="{$key}"
{if $this->admin_checkboxes_selected[$key]}
checked="checked"
{/if}
>{$item}
</label>
</li>
{/foreach}
Not a big deal really, but the html_checkboxes() function does seem to
be more elegant, perhaps this would be a feature request?
Kevin