Fixed yii\helpers\Html::activeTextarea() does not allow value overriding via options

This commit is contained in:
Klimov Paul
2015-05-29 12:31:52 +03:00
parent 22c4de7cdd
commit 0874ffac38
3 changed files with 14 additions and 1 deletions

View File

@ -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);
}