src/Form/BookingType.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Booking;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  6. use Symfony\Component\Form\Extension\Core\Type\IntegerType;
  7. use Symfony\Component\Form\FormBuilderInterface;
  8. use Symfony\Component\OptionsResolver\OptionsResolver;
  9. class BookingType extends AbstractType
  10. {
  11.     public function buildForm(FormBuilderInterface $builder, array $options): void
  12.     {
  13.         $builder
  14.             ->add('nom')
  15.             ->add('nbOfSeats'IntegerType::class)
  16.             ->add('mail'EmailType::class)
  17.             ->add('phone');
  18.     }
  19.     public function configureOptions(OptionsResolver $resolver): void
  20.     {
  21.         $resolver->setDefaults([
  22.             'data_class' => Booking::class,
  23.         ]);
  24.     }
  25. }