src/Form/DemandeformationFormType.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Demandeformations;
  4. use Symfony\Component\Form\AbstractType;
  5. use Gregwar\CaptchaBundle\Type\CaptchaType;
  6. use FOS\CKEditorBundle\Form\Type\CKEditorType;
  7. use Symfony\Component\Form\FormBuilderInterface;
  8. use Symfony\Component\Validator\Constraints\File;
  9. use Symfony\Component\OptionsResolver\OptionsResolver;
  10. use Symfony\Component\Form\Extension\Core\Type\UrlType;
  11. use Symfony\Component\Form\Extension\Core\Type\FileType;
  12. use Symfony\Component\Form\Extension\Core\Type\TextType;
  13. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  14. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  15. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  16. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  17. class DemandeformationFormType extends AbstractType
  18. {
  19.     public function buildForm(FormBuilderInterface $builder, array $options): void
  20.     {
  21.         $builder
  22.         ->add('theme'TextType::class, [
  23.             'required' => true,
  24.             'attr' => [
  25.                 'class' => 'form-control',
  26.             ],
  27.             'label' => "Thème de la formation souhaité"])
  28.         ->add('lieu'TextType::class, [
  29.             'required' => true,
  30.             'attr' => [
  31.                 'class' => 'form-control mt-1 mb-1',
  32.                 'minlenght' => '2',
  33.                 'maxlenght' => '100'
  34.             ],
  35.             'label' => "Lieu de la formation souhaité"])
  36.         ->add('duree'TextType::class, [
  37.             'required' => true,
  38.             'attr' => [
  39.                 'class' => 'form-control mt-1 mb-1',
  40.                 'minlenght' => '2',
  41.                 'maxlenght' => '100'
  42.             ],
  43.             'label' => "Date de la formation souhaitée"])
  44.             
  45.         ->add('nombrepart'TextType::class, [
  46.             'required' => true,
  47.             'attr' => [
  48.                 'class' => 'form-control mt-1 mb-1',
  49.                 'minlenght' => '2',
  50.                 'maxlenght' => '100'
  51.             ],
  52.             'label' => "Nombre de participants"])    
  53.         ->add('fonction'TextType::class, [
  54.             'required' => true,
  55.             'attr' => [
  56.                 'class' => 'form-control mt-1 mb-1',
  57.             ],
  58.             'label' => "Fonction"])
  59.         ->add('nom'TextType::class, [
  60.             'required' => true,
  61.             'attr' => [
  62.                 'class' => 'form-control mt-1 mb-1',
  63.             ],
  64.             'label' => "Nom"])
  65.         ->add('prenoms'TextType::class, [
  66.             'required' => true,
  67.             'attr' => [
  68.                 'class' => 'form-control mt-1 mb-1',
  69.             ],
  70.             'label' => "Prénoms"])
  71.       
  72.         ->add('mail'EmailType::class, [
  73.             'required' => true,
  74.             'attr' => [
  75.                 'class' => 'form-control mt-1 mb-1',
  76.                 'minlenght' => '2',
  77.                 'maxlenght' => '100'
  78.             ],
  79.             'label' => "Adresse email"])
  80.         ->add('entreprise'TextType::class, [
  81.             'required' => true,
  82.             'attr' => [
  83.                 'class' => 'form-control mt-1 mb-1',
  84.             ],
  85.             'label' => "Entreprise ou Projet de Financement"])
  86.         ->add('siteweb'UrlType::class, [
  87.             'required' => true,
  88.             'attr' => [
  89.                 'class' => 'form-control mt-1 mb-1',
  90.             ],
  91.             'label' => "Site Web de votre Entreprise"])
  92.         ->add('telephone'TextType::class, [
  93.             'required' => true,
  94.             'attr' => [
  95.                 'class' => 'form-control mt-1 mb-1',
  96.             ],
  97.             'label' => "Numéro de téléphone"])
  98.           
  99.         ->add('adresse'TextType::class, [
  100.             'required' => true,
  101.             'attr' => [
  102.                 'class' => 'form-control mt-1 mb-1',
  103.             ],
  104.             'label' => "Adresse"])    
  105.         ->add('commentaire'TextareaType::class, [
  106.             'required' => true,
  107.             'attr' => [
  108.                 'class' => 'form-control textarea',
  109.             ],
  110.             'label' => "Commentaire"])
  111.         ->add('captcha'CaptchaType::class, [
  112.             'required' => true,
  113.             'label' => 'Saisissez le texte ci-dessus',
  114.             'attr' => [
  115.                 'class' => 'form-control mb-1 captcha',
  116.                 'style' =>'width: 100%'
  117.             ],])
  118.  
  119.         ->add('submit'SubmitType::class, [
  120.             'attr' => [
  121.                'class' => 'btn btn-primary btn-large',
  122.                'style' =>'font-family: arial'
  123.            ],
  124.             'label' => 'Demander un dévis']);
  125.         // ...
  126.     }
  127.     
  128.     public function configureOptions(OptionsResolver $resolver): void
  129.     {
  130.         $resolver->setDefaults([
  131.             'data_class' => Demandeformations::class,
  132.         ]);
  133.     }
  134. }