Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit 397f831

Browse files
committed
support markupfield
1 parent 759cb25 commit 397f831

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Form/WebformComponentType.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Mdespeuilles\WebformBundle\Form;
44

5+
use Mdespeuilles\MarkupFieldBundle\Form\Type\MarkupType;
56
use Sonata\CoreBundle\Form\Type\BooleanType;
67
use Symfony\Component\Form\AbstractType;
78
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
@@ -32,7 +33,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
3233
'choices' => ChoiceType::class,
3334
'checkbox' => CheckboxType::class,
3435
'E-mail' => EmailType::class,
35-
'Texte Long' => TextareaType::class
36+
'Texte Long' => TextareaType::class,
37+
'Markup' => MarkupType::class
3638
]
3739
])
3840
->add('required', CheckboxType::class)

Form/WebformType.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use AppBundle\Entity\Webform;
66
use AppBundle\Entity\WebformComponent;
77
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
8+
use Mdespeuilles\MarkupFieldBundle\Form\Type\MarkupType;
89
use Sonata\CoreBundle\Form\Type\BooleanType;
910
use Symfony\Component\Form\AbstractType;
1011
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
@@ -39,6 +40,11 @@ public function buildForm(FormBuilderInterface $builder, array $options)
3940
],
4041
'label' => $component->getName()
4142
];
43+
44+
if ($component->getType() == MarkupType::class) {
45+
$componentOptions['label'] = false;
46+
$componentOptions['markup'] = $component->getName();
47+
}
4248

4349
if ($component->isHideLabel()) {
4450
$componentOptions['label'] = false;

0 commit comments

Comments
 (0)