[html-formfu] [patch] reverse order of labels and fields, redux

Toby Corkindale toby.corkindale at strategicdata.com.au
Mon Jul 20 05:44:17 GMT 2009


Ronald J Kimball wrote:
> The attached patch allows more control over reversing the order of 
> labels and fields, which I've found to be very useful.  (Currently, the 
> only option is reverse_multi, which is only for fields within a multi 
> block.)
> 
> 
> The patch adds two new options:
> 
> reverse_single, in _Field.  If reverse_single is true, the label will 
> appear after the field.  (Unless the label tag is 'legend'; the legend 
> always appears first within the container tag.)  Defaults to false.
> 
> reverse_group, in Checkboxgroup and Radiogroup.  If reverse_group is 
> true, the label will appear after the field.  Defaults to true.
> 
> 
> The patch includes documentation and tests.  The default values preserve 
> existing behavior.  All tests pass, for both string and template rendering.
> 
> 
> Feedback appreciated!

I have similar requirements to you; currently I achieve them via a 
fairly nasty output processor. :(
I look forward to your patch, or something similar, being adopted in trunk.

I would like it if there was a way to adjust the defaults, ie. so all 
checkboxes/radio-buttons would have their labels to the right.

I suppose I could do this by extending Element::Checkbox into 
Element::Checkbox::Reversed, and setting it myself, but given that it's 
surely going to be a popular requirement, I think a default option would 
make more sense.

Cheers,
Toby



More information about the HTML-FormFu mailing list