diff --git a/src/Limenius/Liform/Transformer/AbstractTransformer.php b/src/Limenius/Liform/Transformer/AbstractTransformer.php index 405e7d1..302487c 100644 --- a/src/Limenius/Liform/Transformer/AbstractTransformer.php +++ b/src/Limenius/Liform/Transformer/AbstractTransformer.php @@ -56,6 +56,7 @@ protected function addCommonSpecs( $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); @@ -63,6 +64,27 @@ protected function addCommonSpecs( return $schema; } + /** + * @param FormInterface $form + * @param array $schema + * + * @return array + */ + protected function addDisabled(FormInterface $form, array $schema): array + { + if ($form->getConfig()->getOption('disabled')) { + $schema['disabled'] = true; + } + + return $schema; + } + + /** + * @param FormInterface $form + * @param array $schema + * + * @return array + */ protected function addPattern(FormInterface $form, array $schema): array { if ($attr = $form->getConfig()->getOption('attr')) {