views:

43

answers:

1

I have an object that's an instance of a Zend_Form_Element_Radio. I'd like to customize how these radio buttons are displayed. The manual remarks

Radio elements allow you to specify several options, of which you need a single value returned. Zend_Form_Element_Radio extends the base Zend_Form_Element_Multi class, allowing you to specify a number of options, and then uses the formRadio view helper to display these.

However, I'm not picking on the context of a HOW the formRadio helper should be used, and how that would allow me to customize the display.

Before I dig too deeply into the Zend source, is there something obvious I'm missing, and/or a straight forward explanation of the intended use?

A: 

I did a bit of misreading there. Objects instantiated from Zend_Form_Element_Radio have a property named $helper, which defaults to formMyhelper. This property determines the name of the helper that a Zend_Form_Element_Radio will use while rendering itself.

Alan Storm
Yeah you are correct, if you want to modify how you are displaying the radio buttons then just write yourself a new helper class (they aren't very hard) and use that instead either by wrapping a new class around the Zend_Form_Element_Radio (My_Form_Element_Radio) or changing the helper when instantiating the element (not that great an idea as you will need to do it over and over and over)
Matt Wheeler