<?php
namespace App\Form;
use App\Entity\Country;
use App\Entity\User;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class VisitorRegistrationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', HiddenType::class, [
'label' => 'Email',
'attr' => ['class' => 'form-control con_input height-50', 'placeholder' => 'Ex: aaaaa@cofina.com']
])
->add('lastname', TextType::class, [
'label' => 'Nom',
'label_attr' => ['class' => 'h2 fw-bold opificio'],
'attr' => ['class' => 'form-control con_input height-50', 'placeholder' => 'EX:YAO']
])
->add('firstname', TextType::class, [
'label' => 'Prénom(s)',
'label_attr' => ['class' => 'h2 fw-bold opificio'],
'attr' => ['class' => 'form-control con_input height-50', 'placeholder' => 'EX:YANIEL']
])
->add('country', EntityType::class, [
'class' => Country::class,
'choice_label' => 'name',
'label' => 'Pays',
'label_attr' => ['class' => 'h2 fw-bold opificio'],
'attr' => ['class' => 'form-control con_input']
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => User::class,
]);
}
}