Skip to content

Commit

Permalink
Add 'disabled' option in data serialized
Browse files Browse the repository at this point in the history
  • Loading branch information
JMarie committed Feb 4, 2021
1 parent f45af09 commit 06b7a5c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Limenius/Liform/Transformer/AbstractTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,28 @@ protected function addCommonSpecs(FormInterface $form, array $schema, $extension
$schema = $this->addLabel($form, $schema);
$schema = $this->addAttr($form, $schema);
$schema = $this->addPattern($form, $schema);
$schema = $this->addDisabled($form, $schema);
$schema = $this->addDescription($form, $schema);
$schema = $this->addWidget($form, $schema, $widget);
$schema = $this->applyExtensions($extensions, $form, $schema);

return $schema;
}

/**
* @param FormInterface $form
* @param array $schema
*
* @return array
*/
protected function addDisabled(FormInterface $form, array $schema)
{
if ($form->getConfig()->getOption('disabled')) {
$schema['disabled'] = true;
}

return $schema;
}

/**
* @param FormInterface $form
Expand Down

0 comments on commit 06b7a5c

Please sign in to comment.