mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Adds i18n support for the form field default property (#3546)
Credit to @Farrow. Previously when creating a backend form with RainLab.Builder if you filled in the "Default" property using the i18n (to get, for example, acme.plugin::lang.field.default) then that string would be output exactly on the form (i.e. <input value="acme.plugin::lang.field.default"...>) instead of being replaced with the actual value of that key from the lang file.
This commit is contained in:
parent
8e9b3dba54
commit
a1fb23a984
@ -1071,7 +1071,7 @@ class Form extends WidgetBase
|
||||
}
|
||||
|
||||
$defaultValue = !$this->model->exists
|
||||
? $field->getDefaultFromData($this->data)
|
||||
? trans($field->getDefaultFromData($this->data))
|
||||
: null;
|
||||
|
||||
return $field->getValueFromData($this->data, $defaultValue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user