mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 02:13:17 +08:00
Merge pull request #12230 from RangelReale/activelistvalue
Allows BaseHtml::activeListInput to override the field value
This commit is contained in:
@ -35,6 +35,7 @@ Yii Framework 2 Change Log
|
|||||||
- Bug #11973: Fixed `yii\helpers\BaseHtml::getAttributeValue()` to work with `items[]` notation correctly (silverfire)
|
- Bug #11973: Fixed `yii\helpers\BaseHtml::getAttributeValue()` to work with `items[]` notation correctly (silverfire)
|
||||||
- Bug #12100: Fixed `yii\filters\HttpCache` was sending an empty Pragma header (sergeymakinen)
|
- Bug #12100: Fixed `yii\filters\HttpCache` was sending an empty Pragma header (sergeymakinen)
|
||||||
- Bug #12107: Fixed REST Serializer to validate input for 'expand' and 'fields' parameter, which crashed on array input (njspok, cebe)
|
- Bug #12107: Fixed REST Serializer to validate input for 'expand' and 'fields' parameter, which crashed on array input (njspok, cebe)
|
||||||
|
- Enh #12230: Allows BaseHtml::activeListInput to override the field value (RangelReale)
|
||||||
|
|
||||||
|
|
||||||
2.0.9 July 11, 2016
|
2.0.9 July 11, 2016
|
||||||
|
|||||||
@ -1648,7 +1648,7 @@ class BaseHtml
|
|||||||
protected static function activeListInput($type, $model, $attribute, $items, $options = [])
|
protected static function activeListInput($type, $model, $attribute, $items, $options = [])
|
||||||
{
|
{
|
||||||
$name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute);
|
$name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute);
|
||||||
$selection = static::getAttributeValue($model, $attribute);
|
$selection = isset($options['value']) ? $options['value'] : static::getAttributeValue($model, $attribute);
|
||||||
if (!array_key_exists('unselect', $options)) {
|
if (!array_key_exists('unselect', $options)) {
|
||||||
$options['unselect'] = '';
|
$options['unselect'] = '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user