<?php
namespace App\Form;
use App\Entity\Reservation;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ReservationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('firstName', null, [
'label' => 'Prénom',
'attr' => [
'placeholder' => 'Prénom',
'class' => 'input'
]
])
->add('lastName', null, [
'label' => 'Nom',
'attr' => [
'placeholder' => 'Nom',
'class' => 'input'
]
])
->add('email', null, [
'label' => 'Email',
'attr' => [
'placeholder' => 'Email',
'class' => 'input'
]
])
->add('phone', null, [
'label' => 'Téléphone',
'attr' => [
'placeholder' => 'Téléphone',
'class' => 'input'
]
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Reservation::class,
]);
}
}