Open esl51 opened 4 years ago
@esl51 I don't think it needs to be changed:
If each array has an element with the same string key value, the latter will overwrite the former
in this case - defaultOptions
will be overwriting options
all the time.
in this case -
defaultOptions
will be overwritingoptions
all the time.
But I can't overwrite this options.
This is my code (I need to add input-lg
class to input):
echo $form->field($model, 'phone', ['options' => [
'class' => 'form-group form-field-col col-xs-12'
]])->widget(PhoneInput::className(), ['defaultOptions' => [
'class' => 'form-control input-lg' // this line is not working
]]);
ArrayHelper::merge merging from second array to first. Now we can override default options.