jeudi 16 avril 2015

Symfony2 Forms GET submit field type - remove 'name' param

I'm using submit form type in my FormType class (I want it to be customized for css classes and button label).


Since it's a search, I decided to go with GET, not default POST. What I noticed in Symfony2, is that:



I tried to remove auto-genarated HTML "name" attr from the "button / submit" HTML tag in controller, in form type class, and even in Twig template, e.g. by overriding "name" - nothing seems to work for Symfony2, and the name="submit" for this button is always generated.


It there a way to remove this HTML attr from submit button, or am I forced to only render whole submit button by myself, and remove it from Form Type class?


Aucun commentaire:

Enregistrer un commentaire