How would I format Zend_Form_Element_Radio so the label follows the input?

前端 未结 6 950
猫巷女王i
猫巷女王i 2021-01-05 20:41

The default decorator for the Zend_Form_Element_Radio is

6条回答
  •  旧巷少年郎
    2021-01-05 21:10

    i've create a custom view helper named MyLib_View_Helper_FormRadio (so it's called automatically if your bootstraping does so), and overrode and changed the Zend_View_Helper_FormRadio::formRadio() method at Line 160 (Version 1.11), where the radio button is created.


    $label = '';
    
            // Wrap the radios in labels
            $radio =  '_htmlAttribs($attribs)
                    . $endTag;
    
            if ('prepend' == $labelPlacement) {
                $radio = $label . $radio;
            }
            elseif ('append' == $labelPlacement) {
                $radio .= $label;
            }
    

提交回复
热议问题