36 lines
958 B
PHP
36 lines
958 B
PHP
<?php
|
|
|
|
namespace App\Form;
|
|
|
|
use App\Entity\Patient;
|
|
use Symfony\Component\Form\AbstractType;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
|
|
class PatientType extends AbstractType
|
|
{
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
|
{
|
|
$builder
|
|
->add('lastname', TextType::class, [
|
|
'label'=> 'Nom'
|
|
])
|
|
->add('firstname')
|
|
->add('birthdate', DateType::class, [
|
|
'years' => range(intval(date('Y')) - 10, 1920),
|
|
|
|
])
|
|
->add('donneurNumber', TextType::class)
|
|
;
|
|
}
|
|
|
|
public function configureOptions(OptionsResolver $resolver): void
|
|
{
|
|
$resolver->setDefaults([
|
|
'data_class' => Patient::class,
|
|
]);
|
|
}
|
|
}
|