<?php
namespace App\Form;
use App\Entity\FormationsSessions;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
class FormationsSessionsType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('label',null,['label'=>'Intitulé :'])
->add('formation',EntityType::class, array('label' => 'Formation :',
'class' => 'App:Formations',
'choice_label' => 'label',
'multiple' => false, 'expanded' => false))
->add('startingDate',null,['label'=>"Date de début :", 'widget'=>'single_text'])
->add('endDate',null,['label'=>"Date de fin :", 'widget'=>'single_text'])
->add('description',null,['label'=>"Description :"])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => FormationsSessions::class,
]);
}
}