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')) {
$placeholder = $field->Title() .($field->hasClass('requiredField') ? '*' : '');
$field->setAttribute(
'placeholder',
$placeholder
);
if (!Config::inst()->get(\get_class($this->owner), 'no_placeholders')) {
$field->setAttribute(
'placeholder',
$placeholder
);
}
/*
* SilverStripe\UserForms\Form\UserForm: