<?php
namespace App\Form;
use App\Entity\User;
use App\Entity\Ville;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\IsTrue;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\TelType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Validator\Constraints\File;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use App\Form\ExperienceType;
use Symfony\Component\Form\Extension\Core\Type\BirthdayType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Validator\Constraints\Image;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class RecruiterFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username', TextType::class, [
'label' => "Nom"
])
->add('lastname', TextType::class, [
'label' => "Prénom"
])
->add('email', EmailType::class, [
'label' => "Email"
])
->add('password', PasswordType::class, [
'label' => "Mot de passe"
])
->add('confirm_password', PasswordType::class, [
'label' => "Confirm mot de passe"
])
->add('phone', NumberType::class, [
'label' => "Télèphone"
])
->add('sexe', ChoiceType::class, [
'choices' => [
'Masculin' => 'masculin',
'Féminin' => 'feminin'
],
'mapped' => false,
'label' => 'Genre'
])
->add('address', TextType::class)
->add('ville', TextType::class, [
'label' => 'Ville'
])
->add('naissance', BirthdayType::class, [
'widget' => 'single_text',
'label' => 'Date de naissance',
'format' => 'yyyy-MM-dd',
'attr' => [
'class' => 'form-control'
]
])
->add('etablissement')
->add('logo', FileType::class, [
'mapped' => false,
'required' => false,
'constraints' => [
new Image([
'maxSize' => '10M'
])
]
])
->add('a_propos',TextareaType::class)
->add('matricule', TextType::class, [])
->add('Submit', SubmitType::class,['label' =>'Valider']);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => User::class,
]);
}
}