Astuces en vrac
Créer un bouton retour en arriere
Dans le code xxxxFormType.php de votre formulaire.
Il faut ajouter un champ type ButtonType
(en NON SubmitType
)
et lui ajouter l'attribut HTML onclick = “history.back()”
public function buildForm(FormBuilderInterface $builder, array $options): void { $builder -> .... ->add('back', ButtonType::class, [ 'attr' => [ 'onclick' => 'window.history.back()' ], 'label' => '< Back', ]); }
Vous pourriez laisser un commentaire si vous étiez connecté.