0

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.

2

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.