|
|
@ -254,9 +254,11 @@ class ActiveField extends \yii\widgets\ActiveField |
|
|
|
'labelOptions' => ['class' => 'checkbox-inline'], |
|
|
|
'labelOptions' => ['class' => 'checkbox-inline'], |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
} elseif (!isset($options['item'])) { |
|
|
|
} elseif (!isset($options['item'])) { |
|
|
|
$options['item'] = function ($index, $label, $name, $checked, $value) { |
|
|
|
$itemOptions = isset($options['itemOptions']) ? $options['itemOptions'] : []; |
|
|
|
return '<div class="checkbox">' . Html::checkbox($name, $checked, ['label' => $label, 'value' => $value]) . '</div>'; |
|
|
|
$options['item'] = function ($index, $label, $name, $checked, $value) use ($itemOptions) { |
|
|
|
|
|
|
|
$options = array_merge(['label' => $label, 'value' => $value], $itemOptions); |
|
|
|
|
|
|
|
return '<div class="checkbox">' . Html::checkbox($name, $checked, $options) . '</div>'; |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
parent::checkboxList($items, $options); |
|
|
|
parent::checkboxList($items, $options); |
|
|
@ -280,9 +282,11 @@ class ActiveField extends \yii\widgets\ActiveField |
|
|
|
'labelOptions' => ['class' => 'radio-inline'], |
|
|
|
'labelOptions' => ['class' => 'radio-inline'], |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
} elseif (!isset($options['item'])) { |
|
|
|
} elseif (!isset($options['item'])) { |
|
|
|
$options['item'] = function ($index, $label, $name, $checked, $value) { |
|
|
|
$itemOptions = isset($options['itemOptions']) ? $options['itemOptions'] : []; |
|
|
|
return '<div class="radio">' . Html::radio($name, $checked, ['label' => $label, 'value' => $value]) . '</div>'; |
|
|
|
$options['item'] = function ($index, $label, $name, $checked, $value) use ($itemOptions) { |
|
|
|
|
|
|
|
$options = array_merge(['label' => $label, 'value' => $value], $itemOptions); |
|
|
|
|
|
|
|
return '<div class="radio">' . Html::radio($name, $checked, $options) . '</div>'; |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
parent::radioList($items, $options); |
|
|
|
parent::radioList($items, $options); |
|
|
|