mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 04:37:42 +08:00
Fixes #11960: Fixed checked option ignore in yii\helpers\BaseHtml::checkbox()
This commit is contained in:
committed by
Alexander Makarov
parent
0ad5afd387
commit
af3b8b2f23
@ -4,6 +4,7 @@ Yii Framework 2 Change Log
|
||||
2.0.16 under development
|
||||
------------------------
|
||||
|
||||
- Bug #11960: Fixed `checked` option ignore in `yii\helpers\BaseHtml::checkbox()` (misantron)
|
||||
- Bug #14759: Fixed `yii\web\JsonResponseFormatter` output for `null` data (misantron)
|
||||
- Bug #16490: Fix schema on rbac init (marcelodeandrade)
|
||||
- Bug #16748: Fixed params when normalize data (marcelodeandrade)
|
||||
|
||||
@ -751,7 +751,10 @@ class BaseHtml
|
||||
*/
|
||||
protected static function booleanInput($type, $name, $checked = false, $options = [])
|
||||
{
|
||||
$options['checked'] = (bool) $checked;
|
||||
// 'checked' option has priority over $checked argument
|
||||
if (!isset($options['checked'])) {
|
||||
$options['checked'] = (bool) $checked;
|
||||
}
|
||||
$value = array_key_exists('value', $options) ? $options['value'] : '1';
|
||||
if (isset($options['uncheck'])) {
|
||||
// add a hidden field so that if the checkbox is not selected, it still submits a value
|
||||
|
||||
Reference in New Issue
Block a user