Reputation: 155
I haven't found a solution for the problem yet. I assume that I can do it through Twig, but I don't know how. I'll be thankful for help.
Upvotes: 0
Views: 96
Reputation: 2059
When you render a widget, you can add class with name foo, like this:
{{ form_widget(form.name, {'attr': {'class': 'foo'}}) }}
If you want to add class foo to form element (tag), then you can use the same syntax:
{{ form(form, { 'attr': {'class': 'foo'} }) }}
Check out official documentation.
Upvotes: 1