src/Form/ReservationType.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Reservation;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Component\OptionsResolver\OptionsResolver;
  7. class ReservationType extends AbstractType
  8. {
  9.     public function buildForm(FormBuilderInterface $builder, array $options)
  10.     {
  11.         $builder
  12.             ->add('firstName'null, [
  13.                 'label' => 'Prénom',
  14.                 'attr' => [
  15.                     'placeholder' => 'Prénom',
  16.                     'class' => 'input'
  17.                 ]
  18.             ])
  19.             ->add('lastName'null, [
  20.                 'label' => 'Nom',
  21.                 'attr' => [
  22.                     'placeholder' => 'Nom',
  23.                     'class' => 'input'
  24.                 ]
  25.             ])
  26.             ->add('email'null, [
  27.                 'label' => 'Email',
  28.                 'attr' => [
  29.                     'placeholder' => 'Email',
  30.                     'class' => 'input'
  31.                 ]
  32.             ])
  33.             ->add('phone'null, [
  34.                 'label' => 'Téléphone',
  35.                 'attr' => [
  36.                     'placeholder' => 'Téléphone',
  37.                     'class' => 'input'
  38.                 ]
  39.             ])
  40.         ;
  41.     }
  42.     public function configureOptions(OptionsResolver $resolver)
  43.     {
  44.         $resolver->setDefaults([
  45.             'data_class' => Reservation::class,
  46.         ]);
  47.     }
  48. }