<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ContactFormType extends AbstractType
{
public function __construct()
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('first_name', TextType::class, [
'attr' => ['placeholder' => 'Prénom']
])
->add('last_name', TextType::class, [
'attr' => ['placeholder' => 'Nom']
])
->add('mail', EmailType::class, [
'attr' => ['placeholder' => 'Email']
])
->add('phone', TextType::class, [
'attr' => ['placeholder' => 'Téléphone'],
'required' => false,
])
->add('subject', TextType::class, [
'attr' => ['placeholder' => 'Sujet'],
'required' => false
])
->add('help', TextareaType::class, [
'attr' => ['placeholder' => 'Message']
])
->add('submit', SubmitType::class)
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([]);
}
}