Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix options merging #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix options merging #63

wants to merge 1 commit into from

Conversation

esl51
Copy link

@esl51 esl51 commented Apr 15, 2020

ArrayHelper::merge merging from second array to first. Now we can override default options.

ArrayHelper::merge merging from second array to first. Now we can override default options.
@esl51
Copy link
Author

esl51 commented Apr 15, 2020

@Borales
Copy link
Owner

Borales commented Apr 15, 2020

@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.

@esl51
Copy link
Author

esl51 commented Apr 16, 2020

in this case - defaultOptions will be overwriting options 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
]]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants