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

$inputOptions in ActiveField #17374

Closed
dicrtarasov opened this issue Jun 16, 2019 · 2 comments
Closed

$inputOptions in ActiveField #17374

dicrtarasov opened this issue Jun 16, 2019 · 2 comments
Labels
status:to be verified Needs to be reproduced and validated. type:bug Bug

Comments

@dicrtarasov
Copy link
Contributor

dicrtarasov commented Jun 16, 2019

ActiveField::checkbox() and ActiveField::radio() lost $inputOptions.

Similar as other functions do:

 $options = array_merge($this->inputOptions, $options);

This issue was fixed for checkbox in 3.x.x:
#861

Please, add this simple fix to 2.x.x and radio() too...

Q A
Yii version 2.0.20
PHP version 7.3
Operating system Linux
@samdark samdark added status:to be verified Needs to be reproduced and validated. type:bug Bug labels Jun 17, 2019
@alexkart
Copy link
Contributor

alexkart commented Jun 18, 2019

Should $this->inputOptions and $options be merged? I think it is done intentionally. In any case, changing this behavior now will break all checkboxes and radio buttons, because \yii\widgets\ActiveField::$inputOptions has a default value:

public $inputOptions = ['class' => 'form-control'];

which will be added to all checkboxes and radio buttons.

@samdark
Copy link
Member

samdark commented Jun 18, 2019

Can't change it because of backwards compatibility as @alexkart explained.

@samdark samdark closed this as completed Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:to be verified Needs to be reproduced and validated. type:bug Bug
Projects
None yet
Development

No branches or pull requests

3 participants