mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 19:12:42 +00:00
Merge remote-tracking branch 'origin/2.0' into 2.0-class-loading
This commit is contained in:
commit
2e2f5ea2a5
4 changed files with 40 additions and 2 deletions
|
@ -1041,6 +1041,7 @@ class FormHelper extends AppHelper {
|
|||
public function radio($fieldName, $options = array(), $attributes = array()) {
|
||||
$attributes = $this->_initInputField($fieldName, $attributes);
|
||||
$legend = false;
|
||||
$disabled = array();
|
||||
|
||||
if (isset($attributes['legend'])) {
|
||||
$legend = $attributes['legend'];
|
||||
|
@ -1066,6 +1067,11 @@ class FormHelper extends AppHelper {
|
|||
} else {
|
||||
$value = $this->value($fieldName);
|
||||
}
|
||||
|
||||
if (isset($attributes['disabled'])) {
|
||||
$disabled = $attributes['disabled'];
|
||||
}
|
||||
|
||||
$out = array();
|
||||
|
||||
$hiddenField = isset($attributes['hiddenField']) ? $attributes['hiddenField'] : true;
|
||||
|
@ -1077,6 +1083,9 @@ class FormHelper extends AppHelper {
|
|||
if (isset($value) && $optValue == $value) {
|
||||
$optionsHere['checked'] = 'checked';
|
||||
}
|
||||
if (!empty($disabled) && in_array($optValue, $disabled)) {
|
||||
$optionsHere['disabled'] = true;
|
||||
}
|
||||
$tagName = Inflector::camelize(
|
||||
$attributes['id'] . '_' . Inflector::slug($optValue)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue