add('titre', TextType::class) ->add('annee', DateType::class, array( 'widget' => 'single_text', 'label' => 'Année', 'years' => range(1930, 2050, 1), 'html5' => false, 'format' => 'yyyy', 'required' => false )) ->add('lien', TextType::class, array( 'required' => false )) ->add('mediaVideos', CollectionType::class, [ 'entry_type' => MediaVideoType::class, 'entry_options' => array('label'=>false), 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false ]) ->add('dateSortie', DateType::class, [ 'input' => 'datetime_immutable', 'html5' => true, 'widget' => 'single_text', 'required' => false ]) ->add('information', TextareaType::class, [ 'required' => false, 'attr' => [ 'rows' => 5 ] ]) ->add('genres', CollectionType::class, [ 'entry_type' => GenreType::class, 'entry_options' => array('label'=>false), 'allow_add' => true, 'allow_delete' => true ]) ->add('realisateurs', CollectionType::class, [ 'entry_type' => RealisateurType::class, 'entry_options' => array('label'=>false), 'allow_add' => true, 'allow_delete' => true, 'allow_extra_fields' => true ]) ->add('save', SubmitType::class, array('label' => 'Enregistrer')); } /** * {@inheritdoc} */ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Film::class ]); } /** * {@inheritdoc} */ public function getBlockPrefix() : string { return 'App_film'; } }