IMPR: Allow to hide placeholders

This commit is contained in:
Tony Air 2022-06-28 11:04:34 +02:00
parent f37d4b2e92
commit 8b840d16a5

View File

@ -28,10 +28,12 @@ class PlaceholderFormExtension extends Extension
if (!$field->getAttribute('placeholder')) { if (!$field->getAttribute('placeholder')) {
$placeholder = $field->Title() .($field->hasClass('requiredField') ? '*' : ''); $placeholder = $field->Title() .($field->hasClass('requiredField') ? '*' : '');
$field->setAttribute( if (!Config::inst()->get(\get_class($this->owner), 'no_placeholders')) {
'placeholder', $field->setAttribute(
$placeholder 'placeholder',
); $placeholder
);
}
/* /*
* SilverStripe\UserForms\Form\UserForm: * SilverStripe\UserForms\Form\UserForm: