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)
|
private function setPlaceholder($field)
|
||||||
{
|
{
|
||||||
if (is_a($field, TextField::class)) {
|
if (is_a($field, TextField::class)) {
|
||||||
$field->setAttribute(
|
if (!$field->getAttribute('placeholder')) {
|
||||||
'placeholder',
|
$placeholder = $field->Title() .($field->hasClass('requiredField') ? '*' : '');
|
||||||
$field->Title()
|
|
||||||
.($field->hasClass('requiredField') ? '*' : '')
|
$field->setAttribute(
|
||||||
);
|
'placeholder',
|
||||||
$field->setTitle('');
|
$placeholder
|
||||||
|
);
|
||||||
|
$field->setTitle('');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_a($field, CompositeField::class)) {
|
if (is_a($field, CompositeField::class)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user