src/Form/FormationsSessionsType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\FormationsSessions;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Component\OptionsResolver\OptionsResolver;
  7. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  8. class FormationsSessionsType extends AbstractType
  9. {
  10.     public function buildForm(FormBuilderInterface $builder, array $options): void
  11.     {
  12.         $builder
  13.             ->add('label',null,['label'=>'IntitulĂ© :'])
  14.             ->add('formation',EntityType::class, array('label' => 'Formation :',
  15.                 'class' => 'App:Formations',
  16.                 'choice_label' => 'label',
  17.                 'multiple' => false'expanded' => false))
  18.             ->add('startingDate',null,['label'=>"Date de dĂ©but :"'widget'=>'single_text'])
  19.             ->add('endDate',null,['label'=>"Date de fin :"'widget'=>'single_text'])
  20.             ->add('description',null,['label'=>"Description :"])
  21.         ;
  22.     }
  23.     public function configureOptions(OptionsResolver $resolver): void
  24.     {
  25.         $resolver->setDefaults([
  26.             'data_class' => FormationsSessions::class,
  27.         ]);
  28.     }
  29. }