mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
Fixed yii\helpers\Html::activeTextarea() does not allow value overriding via options
This commit is contained in:
@ -1331,7 +1331,12 @@ class BaseHtml
|
||||
public static function activeTextarea($model, $attribute, $options = [])
|
||||
{
|
||||
$name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute);
|
||||
$value = static::getAttributeValue($model, $attribute);
|
||||
if (isset($options['value'])) {
|
||||
$value = $options['value'];
|
||||
unset($options['value']);
|
||||
} else {
|
||||
$value = static::getAttributeValue($model, $attribute);
|
||||
}
|
||||
if (!array_key_exists('id', $options)) {
|
||||
$options['id'] = static::getInputId($model, $attribute);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user