<?php
namespace App\Form;
use App\Entity\Rejoindre;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class RejoindreType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('civilite', ChoiceType::class, [
"attr" => array (
"class" => "form-control",
'required' => true,
),
'choices' => [
'Mademoiselle' => 'Mademoiselle',
'Madame' => 'Madame',
'Monsieur' => 'Monsieur',
],
])
->add('nom', TextType::class, [
"attr" => array (
"class" => "form-control",
'required' => true,
)
])
->add('email', EmailType::class, [
"attr" => array (
"class" => "form-control",
'required' => true,
)
])
->add('telephone', TextType::class, [
"attr" => array (
"class" => "form-control",
'required' => true,
)
])
->add('apropos', ChoiceType::class, [
"attr" => array (
"class" => "form-control",
'required' => true,
),
'choices' => [
'Recherche sur internet' => 'Recherche sur internet',
'Recommendé par un ami' => 'Recommendé par un ami',
'Revue de presse positive' => 'Revue de presse positive',
'Autre' => 'Autre',
],
])
->add('poste', ChoiceType::class, [
"attr" => array (
"class" => "form-control",
'required' => true,
),
'choices' => [
'AVT Consultant' => 'AVT Consultant',
'AVT Formation' => 'AVT Formation',
'AVT Ingénierie' => 'AVT Ingénierie',
'AVT BTP' => 'AVT BTP',
'Postuler pour une offre d\'emploi' => 'Postuler pour une offre d\'emploi',
'Candidature spontanée' => 'Candidature spontanée',
],
])
->add('objet', TextType::class, [
"attr" => array (
"class" => "form-control",
'required' => true,
)
])
->add('message', TextareaType::class, [
"attr" => array (
"class" => "form-control",
'required' => true,
)
])
->add('fichier', FileType::class,
array(
'data_class' => null,
'required' => false,
)
)
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Rejoindre::class,
]);
}
}