|
|
@@ -254,6 +254,13 @@ class FormHelper extends Helper
|
|
|
protected $_valueSources = ['context'];
|
|
|
|
|
|
/**
|
|
|
+ * Grouped input types.
|
|
|
+ *
|
|
|
+ * @var array
|
|
|
+ */
|
|
|
+ protected $_groupedInputTypes = ['radio', 'multicheckbox', 'date', 'time', 'datetime'];
|
|
|
+
|
|
|
+ /**
|
|
|
* Construct the widgets and binds the default context providers
|
|
|
*
|
|
|
* @param \Cake\View\View $View The View this helper is being attached to.
|
|
|
@@ -280,6 +287,11 @@ class FormHelper extends Helper
|
|
|
unset($config['widgets']);
|
|
|
}
|
|
|
|
|
|
+ if (isset($config['groupedInputTypes'])) {
|
|
|
+ $this->_groupedInputTypes = $config['groupedInputTypes'];
|
|
|
+ unset($config['groupedInputTypes']);
|
|
|
+ }
|
|
|
+
|
|
|
parent::__construct($View, $config);
|
|
|
|
|
|
if (!$locator) {
|
|
|
@@ -1550,8 +1562,7 @@ class FormHelper extends Helper
|
|
|
}
|
|
|
|
|
|
$labelAttributes['for'] = $options['id'];
|
|
|
- $groupTypes = ['radio', 'multicheckbox', 'date', 'time', 'datetime'];
|
|
|
- if (in_array($options['type'], $groupTypes, true)) {
|
|
|
+ if (in_array($options['type'], $this->_groupedInputTypes, true)) {
|
|
|
$labelAttributes['for'] = false;
|
|
|
}
|
|
|
if ($options['nestedInput']) {
|