There is no way to influence <input> tag attributes within radio and checkbox button groups, other than completely rewriting the entire 'item' callback function which renders everything including the labels. In most use cases we only want to add 1 simple attribute, but we are forced to copy and modify the whole 'item' callback every time.
There is no way to influence
<input>
tag attributes within radio and checkbox button groups, other than completely rewriting the entire'item'
callback function which renders everything including the labels. In most use cases we only want to add 1 simple attribute, but we are forced to copy and modify the whole 'item' callback every time.See: https://github.com/kartik-v/yii2-widget-activeform/blob/52b4db751e80440816f392b682d75f6f8f6585cb/ActiveField.php#L1440
It would be much better if the default
$opts
were merged with'itemOptions'
.