I subclass Zend_Form to allow re-use as I describe in my other SO question. It's working very well, except for one issue that I found. In my view script I use this code to render the label for fields:
echo $this->formLabel($this->element->getFullyQualifiedName(),
$this->element->getLabel());
The rendered label has the original element id as the value in the for attribute rather than the new, suffixed, element id. Is there a bug in the Zend code, am I missing a step or doing something incorrectly?
I think the reason is that you use
formLabelview helper independently. As a result, the helper is not aware of any attributes that you specified for your input text field. So, you should provide these attributes to theformLabel. For example you could do the following:The above code should produce
fortag that matches your input elements id. Otherwise, thefortag will be set to the elements name.