<?php
namespace App\Form;
use App\Entity\Adresse;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class AdressFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('corpsAdresse', TextType::class, [
'trim' => true,
'label' => 'Adresse* : '
])
->add('codePostal',TextType::class, [
'trim' => true,
'label' => 'Code postal* : '
])
->add('ville',TextType::class, [
'trim' => true,
'label' => 'Ville* : '
])
->add('pays',TextType::class, [
'trim' => true,
'label' => 'Pays* : '
]);
// TODO ajouter département?
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Adresse::class,
]);
}
}