0

I have a multistep form with Craue FormFlow in Symfony 3.4.

It works well but I need to show the buttons (next, back) on the top of the form as well as the bottom (by default they show at the bottom only).

I had a look at the documentation for the bundle and could not find any info. Checking the documentation for Symfony I found that I should be able to use

{{ form_widget(form.submit) }}

but that gives me an error

Neither the property "submit" nor one of the methods "submit()", "getsubmit()"/"issubmit()"/"hassubmit()" or "__call()" exist and have public access in class "Symfony\Component\Form\FormView".

I can add HTML at the top of the form like

<button type="submit" class="btn btn-primary finish">Next</button>

but then I would have to check every step in order to show the right buttons.

I am looking for a more elegant solution if it exists.

Thanks

Jon
  • 766
  • 1
  • 9
  • 27

1 Answers1

0

you can include this template in your form at the beginning and the end :

{% include '@CraueFormFlow/FormFlow/buttons.html.twig' %}

you can as well use custom classes to improve your display

{% include '@CraueFormFlow/FormFlow/buttons.html.twig' with {
            craue_formflow_button_class_last: 'btn btn-primary ml-1',
            craue_formflow_button_class_finish: 'btn btn-success ml-1',  
            craue_formflow_button_class_next: 'btn btn-primary ml-1', 
            craue_formflow_button_class_back: 'btn btn-primary ml-1', 
            craue_formflow_button_class_reset: 'btn btn-warning ml-1'
        }
    %}
Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47