src/Form/FormationsThematicsType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\FormationsThematics;
  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 FormationsThematicsType 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('domain',EntityType::class, array('label' => 'Domaine :',
  19.                 'class' => 'App:Domains',
  20.                 'choice_label' => 'label',
  21.                 'multiple' => false'expanded' => false))
  22.             ->add('mainObjective',null,['label'=>'Objectif général :'])
  23.             ->add('specificsObjectives',null,['label'=>'Objectifs spécifiques :'])
  24.             ->add('target',null,['label'=>'Cible :'])
  25.             ->add('cost',null,['label'=>'Coût :'])
  26.             ->add('duration',null,['label'=>'Durée :'])
  27.             ->add('details',null,['label'=>'Détails :','attr'=>['class'=>'ckeditor']])
  28.         ;
  29.     }
  30.     public function configureOptions(OptionsResolver $resolver): void
  31.     {
  32.         $resolver->setDefaults([
  33.             'label' => 'Thématique de formation',
  34.             'data_class' => FormationsThematics::class,
  35.         ]);
  36.     }
  37. }