mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
IMPR: Form placeholders
This commit is contained in:
parent
f13643afca
commit
4d8ab97973
@ -19,12 +19,15 @@ class PlaceholderFormExtension extends Extension
|
||||
private function setPlaceholder($field)
|
||||
{
|
||||
if (is_a($field, TextField::class)) {
|
||||
$field->setAttribute(
|
||||
'placeholder',
|
||||
$field->Title()
|
||||
.($field->hasClass('requiredField') ? '*' : '')
|
||||
);
|
||||
$field->setTitle('');
|
||||
if (!$field->getAttribute('placeholder')) {
|
||||
$placeholder = $field->Title() .($field->hasClass('requiredField') ? '*' : '');
|
||||
|
||||
$field->setAttribute(
|
||||
'placeholder',
|
||||
$placeholder
|
||||
);
|
||||
$field->setTitle('');
|
||||
}
|
||||
}
|
||||
|
||||
if (is_a($field, CompositeField::class)) {
|
||||
|
Loading…
Reference in New Issue
Block a user