Skip to content

Commit

Permalink
Add support for Placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
edhgoose committed Aug 1, 2022
1 parent 7a00f06 commit 0cb402a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Limenius/Liform/Transformer/AbstractTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ protected function applyExtensions(array $extensions, FormInterface $form, array
protected function addCommonSpecs(FormInterface $form, array $schema, $extensions = [], $widget)
{
$schema = $this->addLabel($form, $schema);
$schema = $this->addPlaceholder($form, $schema);
$schema = $this->addAttr($form, $schema);
$schema = $this->addPattern($form, $schema);
$schema = $this->addDescription($form, $schema);
Expand All @@ -77,6 +78,14 @@ protected function addCommonSpecs(FormInterface $form, array $schema, $extension
return $schema;
}

public function addPlaceholder(FormInterface $form, array $schema)
{
if ($attr = $form->getConfig()->getOption('placeholder')) {
$schema['placeholder'] = $attr;
}

return $schema;
}

/**
* @param FormInterface $form
Expand Down

0 comments on commit 0cb402a

Please sign in to comment.