ZF-6426: Radio button getting invalid XHTML label

Description

when providing label for the radio buttons an invalid xhtml is created because there is no ID associated with the label form.

Results now:

buggy 01

Should be:

buggy 01

Comments

Here is a corrected version by Dennis Day

I have attached a revised version of FormLabel.php for testing and review.

The patch as provided will not work, as it makes the invalid assumption that the form is assigned to the view as the variable "form".

A better approach would be to modify the FormLabel view helper to allow suppression of the "for" attribute via an options flag, and passing that option from the decorator.

Resolved in trunk and 1.9 release branch.

FormLabel view helper now has a "disableFor" option. If enabled, no "for" attribute will be created. Zend_Form_Element_FormRadio now sets this option by default.

Oops. I tried.

This fix created another bug: http://framework.zend.com/issues/browse/ZF-8265