diff --git a/modules/backend/classes/FormField.php b/modules/backend/classes/FormField.php index 5f37697dc..2bb2275fa 100644 --- a/modules/backend/classes/FormField.php +++ b/modules/backend/classes/FormField.php @@ -262,17 +262,18 @@ class FormField * Standard config:property values */ $applyConfigValues = [ - 'context', + 'commentHtml', 'placeholder', - 'cssClass', 'dependsOn', + 'required', + 'disabled', + 'cssClass', + 'stretch', + 'context', + 'hidden', 'trigger', 'preset', 'path', - 'required', - 'disabled', - 'hidden', - 'stretch', ]; foreach ($applyConfigValues as $value) { @@ -332,11 +333,15 @@ class FormField * @param bool $isHtml Set to true if you use HTML formatting in the comment * Supported values are 'below' and 'above' */ - public function comment($text, $position = 'below', $isHtml = false) + public function comment($text, $position = 'below', $isHtml = null) { $this->comment = $text; $this->commentPosition = $position; - $this->commentHtml = $isHtml; + + if ($isHtml !== null) { + $this->commentHtml = $isHtml; + } + return $this; } diff --git a/modules/backend/widgets/form/partials/_field.htm b/modules/backend/widgets/form/partials/_field.htm index de08dd3b1..4b52b9a08 100644 --- a/modules/backend/widgets/form/partials/_field.htm +++ b/modules/backend/widgets/form/partials/_field.htm @@ -5,6 +5,9 @@ renderFieldElement($field) ?> + commentHtml ? trans($field->comment) : e(trans($field->comment)); + ?> label): ?>