@@ -1510,6 +1510,7 @@ public function checkbox($fieldName, $options = array()) {
1510
1510
* - `between` - the string between legend and input set or array of strings to insert
1511
1511
* strings between each input block
1512
1512
* - `legend` - control whether or not the widget set has a fieldset & legend
1513
+ * - `fieldset` - sets the class of the fieldset. Fieldset is only generated if legend attribute is provided
1513
1514
* - `value` - indicate a value that is should be checked
1514
1515
* - `label` - boolean to indicate whether or not labels for widgets show be displayed
1515
1516
* - `hiddenField` - boolean to indicate if you want the results of radio() to include
@@ -1544,6 +1545,12 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
1544
1545
$ legend = __ (Inflector::humanize ($ this ->field ()));
1545
1546
}
1546
1547
1548
+ $ fieldset = '' ;
1549
+ if (isset ($ attributes ['fieldset ' ])) {
1550
+ $ fieldset = $ attributes ['fieldset ' ];
1551
+ unset($ attributes ['fieldset ' ]);
1552
+ }
1553
+
1547
1554
$ label = true ;
1548
1555
if (isset ($ attributes ['label ' ])) {
1549
1556
$ label = $ attributes ['label ' ];
@@ -1638,7 +1645,12 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
1638
1645
$ between = '' ;
1639
1646
}
1640
1647
if ($ legend ) {
1641
- $ out = $ this ->Html ->useTag ('fieldset ' , '' , $ this ->Html ->useTag ('legend ' , $ legend ) . $ between . $ out );
1648
+ if (is_string ($ fieldset )) {
1649
+ $ fieldsetClass = sprintf (' class="%s" ' , $ fieldset );
1650
+ } else {
1651
+ $ fieldsetClass = '' ;
1652
+ }
1653
+ $ out = $ this ->Html ->useTag ('fieldset ' , $ fieldsetClass , $ this ->Html ->useTag ('legend ' , $ legend ) . $ between . $ out );
1642
1654
}
1643
1655
return $ out ;
1644
1656
}
0 commit comments