src/Form/EmailType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  4. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  5. use App\Entity\Email;
  6. use Symfony\Component\Form\AbstractType;
  7. use Symfony\Component\Form\FormBuilderInterface;
  8. use Symfony\Component\OptionsResolver\OptionsResolver;
  9. class EmailType extends AbstractType
  10. {
  11.     public function buildForm(FormBuilderInterface $builder, array $options): void
  12.     {
  13.         $builder
  14.         ->add('subject'ChoiceType::class, array(
  15.             'attr' => ['class' => 'form-control'],
  16.             'choices' => array(
  17.                 'RENSEIGNEMENT' => 'RENSEIGNEMENT',
  18.                 'TEMOIGNAGE' => 'TEMOIGNAGE',
  19.                 'SUGGESTION' => 'SUGGESTION',
  20.                 'DON' => 'FAIRE UN DON',
  21.                 'PLAINTE' => 'PLAINTE'
  22.                
  23.             ),'label' => 'Objet'))
  24.             ->add('content'TextareaType::class, [
  25.                 'attr' => ['class' => 'form-control'],
  26.             ])
  27.           
  28.         ;
  29.     }
  30.     public function configureOptions(OptionsResolver $resolver): void
  31.     {
  32.         $resolver->setDefaults([
  33.             'data_class' => Email::class,
  34.         ]);
  35.     }
  36. }