src/Form/ContactType.php line 13
<?php
namespace App\Form;
use App\Entity\Contact;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class ContactType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TextType::class, [
'label' => 'Nom',
'attr' => [
'class' => 'form-control border-0 bg-light px-4'
]
])
->add('email', EmailType::class, [
'label' => 'Votre email',
'attr' => [
'class' => 'form-control border-0 bg-light px-4'
]
])
->add('subject', TextType::class, [
'label' => 'Sujet',
'attr' => [
'class' => 'form-control border-0 bg-light px-4'
]
])
->add('message', TextType::class, [
'label' => 'Votre message',
'attr' => [
'class' => 'form-control border-0 bg-light px-4'
]
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Contact::class,
]);
}
}