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('mediaVideo', MediaVideoType::class,array( 'required' => false, )) ->add('genres', CollectionType::class, array( 'entry_type' => GenreType::class, 'entry_options' => array('label'=>false), 'allow_add' => true, 'allow_delete' => true )) ->add('realisateurs', CollectionType::class, array( '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) { $resolver->setDefaults(array( 'data_class' => 'App\Entity\Film' )); } /** * {@inheritdoc} */ public function getBlockPrefix() { return 'App_film'; } }