Skip to content

Commit 7d2b6e6

Browse files
authored
Merge pull request #28 from ubermichael/update-for-3-0
Update KeyValueRowType for Symfony 3.
2 parents cbf5c11 + 8410577 commit 7d2b6e6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Form/Type/KeyValueRowType.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
namespace Burgov\Bundle\KeyValueFormBundle\Form\Type;
44

55
use Symfony\Component\Form\AbstractType;
6-
use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList;
6+
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
7+
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
78
use Symfony\Component\Form\FormBuilderInterface;
89
use Symfony\Component\OptionsResolver\OptionsResolver;
910
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
@@ -15,8 +16,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
1516
if (null === $options['allowed_keys']) {
1617
$builder->add('key', $options['key_type'], $options['key_options']);
1718
} else {
18-
$builder->add('key', 'choice', array_merge(array(
19-
'choice_list' => new SimpleChoiceList($options['allowed_keys'])
19+
$builder->add('key', ChoiceType::class, array_merge(array(
20+
'choices' => $options['allowed_keys']
2021
), $options['key_options']
2122
));
2223
}

0 commit comments

Comments
 (0)