Reputation: 701
I try to use Symfony2's (v2.6.1) button widget. I want it to submit the form (meaning the rendered button should have type="submit"
), but setting in the attr in TWIG doesn't work for me.
{{ form_row(form.theButton, {'attr': {'type': 'submit'}, 'label': 'the custom label I need'}) }}
I can't believe there is no such setting, so I assume I'm missing something from the docs.
Could anybody spell it out for me?
Upvotes: 0
Views: 759
Reputation: 111
Instead of using the 'button'
form field type, use the 'submit'
form field type: http://symfony.com/doc/current/reference/forms/types/submit.html
Upvotes: 3
Reputation: 1315
Try to use form.submit
instead of form.theButton
:
{{ form_row(form.submit, 'label': 'the custom label I need'}) }}
http://symfony.com/doc/current/reference/forms/types/submit.html
Upvotes: 1