]> Raphaƫl G. Git Repositories - userbundle/blobdiff - Form/RegisterType.php
Add strict
[userbundle] / Form / RegisterType.php
index bfedcf72faa6278eb6a3ca2f088db05d94b4b15b..f4327c0f27b3bd95fbe9e6fd9695109ab3901160 100644 (file)
@@ -21,6 +21,7 @@ class RegisterType extends AbstractType {
         * {@inheritdoc}
         */
        public function buildForm(FormBuilderInterface $builder, array $options) {
         * {@inheritdoc}
         */
        public function buildForm(FormBuilderInterface $builder, array $options) {
+               //Create form
                $form = $builder;
 
                //Add extra mail field
                $form = $builder;
 
                //Add extra mail field
@@ -30,7 +31,7 @@ class RegisterType extends AbstractType {
 
                //Add extra civility field
                if (!empty($options['civility'])) {
 
                //Add extra civility field
                if (!empty($options['civility'])) {
-                       $form->add('civility', EntityType::class, ['class' => $options['civility_class'], 'attr' => ['placeholder' => 'Your civility'], 'constraints' => [new NotBlank(['message' => 'Please provide your civility'])], 'choice_translation_domain' => true, 'data' => $options['civility_default']]);
+                       $form->add('civility', EntityType::class, ['class' => $options['civility_class'], 'attr' => ['placeholder' => 'Your civility'], 'constraints' => [new NotBlank(['message' => 'Please provide your civility'])], 'choice_translation_domain' => true, 'empty_data' => $options['civility_default']]);
                }
 
                //Add extra pseudonym field
                }
 
                //Add extra pseudonym field