[Solar-talk] Checkbox and radio labels with Solar_View_Helper_Form
Paul M Jones
pmjones at ciaweb.net
Fri Sep 22 08:26:16 PDT 2006
On Sep 5, 2006, at 11:16 AM, Rodrigo Moraes wrote:
> I'm trying to add a checkbox or radio label using
> Solar_View_Helper_Form:
>
> echo $this->form()
> ->checkbox(array(
> 'name' => 'persist',
> 'value' => '1',
> 'options' => array(0 => 1),
> 'label' => $this->getTextRaw('LABEL_PERSIST'),
> )
> ->submit(array(
> 'name' => 'submit',
> 'value' => $this->getTextRaw('SUBMIT_LOGIN')
> ))
> ->fetch();
>
> The result is a duplicated label for the checkbox.
I have placed a (relatively simple) fix for this in SVN, in the Form
helper. The log entry is, "per note from Rodrigo Moraes, if S-V-H-
Form outputs a checkbox that is not in a group, it does not get its
own label".
Basically, if you have a group of checkboxes, they'll get their own
labels; but if you have a single checkbox, it only gets the "main"
label.
Let me know if this helps or not.
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list