src/Flexy/FrontBundle/Themes/IlaveU/Form/RegistrationVendorFormType.php line 17

  1. <?php
  2. namespace App\Flexy\FrontBundle\Themes\IlaveU\Form;
  3. use App\Entity\User;
  4. use App\Flexy\ShopBundle\Entity\Vendor\Vendor;
  5. use Symfony\Component\Form\AbstractType;
  6. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  7. use Symfony\Component\Form\Extension\Core\Type\PasswordType;
  8. use Symfony\Component\Form\FormBuilderInterface;
  9. use Symfony\Component\OptionsResolver\OptionsResolver;
  10. use Symfony\Component\Validator\Constraints\IsTrue;
  11. use Symfony\Component\Validator\Constraints\Length;
  12. use Symfony\Component\Validator\Constraints\NotBlank;
  13. use Vich\UploaderBundle\Form\Type\VichFileType;
  14. class RegistrationVendorFormType extends AbstractType
  15. {
  16.     public function buildForm(FormBuilderInterface $builder, array $options): void
  17.     {
  18.         $builder
  19.         ->add('name')
  20.         ->add('fullName')
  21.         ->add('tel')
  22.         ->add('email',null,["required"=> true])
  23.         ->add('address')
  24.         ->add('city',null,["label"=>"ville"])
  25.         ->add('ICE')
  26.         ->add('imageIceFile'VichFileType::class, [
  27.             'required' => false,
  28.             'allow_delete' => true,
  29.             'delete_label' => '...',
  30.             'download_uri' => '...',
  31.             'download_label' => '...',
  32.             'asset_helper' => true,
  33.         ])
  34.         ->add('RC')
  35.         ->add('imageRCFile'VichFileType::class, [
  36.             'required' => false,
  37.             'allow_delete' => true,
  38.             'delete_label' => '...',
  39.             'download_uri' => '...',
  40.             'download_label' => '...',
  41.             'asset_helper' => true,
  42.         ])
  43.         ->add('IdentifiantFiscale')
  44.         ->add('imageIFFile'VichFileType::class, [
  45.             'required' => false,
  46.             'allow_delete' => true,
  47.             'delete_label' => '...',
  48.             'download_uri' => '...',
  49.             'download_label' => '...',
  50.             'asset_helper' => true,
  51.         ])
  52.         ->add('simulateUsername',null,["label"=>"identifiant"])
  53.         //->add('simulatePassword')
  54.         ->add('simulatePassword'PasswordType::class, [
  55.             // instead of being set onto the object directly,
  56.             // this is read and encoded in the controller
  57.             "label"=>"Mot de passe",
  58.             'mapped' => false,
  59.             'attr' => ['autocomplete' => 'new-password'],
  60.             'constraints' => [
  61.                 new NotBlank([
  62.                     'message' => 'Please enter a password',
  63.                 ]),
  64.                 new Length([
  65.                     'min' => 6,
  66.                     'minMessage' => 'Your password should be at least {{ limit }} characters',
  67.                     // max length allowed by Symfony for security reasons
  68.                     'max' => 4096,
  69.                 ]),
  70.             ],
  71.         ])
  72.         ->add('agreeTerms'CheckboxType::class, [
  73.             "label"=>'Accepter les conditions gĂ©nerales',
  74.             'mapped' => false,
  75.             'constraints' => [
  76.                 new IsTrue([
  77.                     'message' => 'You should agree to our terms.',
  78.                 ]),
  79.             ],
  80.         ])
  81.         
  82.         /*
  83.             ->add('username')
  84.             ->add('agreeTerms', CheckboxType::class, [
  85.                 'mapped' => false,
  86.                 'constraints' => [
  87.                     new IsTrue([
  88.                         'message' => 'You should agree to our terms.',
  89.                     ]),
  90.                 ],
  91.             ])
  92.             ->add('plainPassword', PasswordType::class, [
  93.                 // instead of being set onto the object directly,
  94.                 // this is read and encoded in the controller
  95.                 'mapped' => false,
  96.                 'attr' => ['autocomplete' => 'new-password'],
  97.                 'constraints' => [
  98.                     new NotBlank([
  99.                         'message' => 'Please enter a password',
  100.                     ]),
  101.                     new Length([
  102.                         'min' => 6,
  103.                         'minMessage' => 'Your password should be at least {{ limit }} characters',
  104.                         // max length allowed by Symfony for security reasons
  105.                         'max' => 4096,
  106.                     ]),
  107.                 ],
  108.             ])
  109.             */
  110.         ;
  111.     }
  112.     public function configureOptions(OptionsResolver $resolver): void
  113.     {
  114.         $resolver->setDefaults([
  115.             'data_class' => Vendor::class,
  116.         ]);
  117.     }
  118. }