Skip to content

form_widget(form, variables) not passing 'attr' array #5565

Closed
@advancingu

Description

@advancingu

I'm using the following code in a Twig template with Symfony 2.1.2-DEV:

    {{ form_widget(myForm, { 'attr': {'class': 'myClass'} }) }}

It appears that the entire attr array is not being passed to the widgets if form_widget() is used with an entire form as an argument. If I call form_widget(myForm.field1, ...) instead, the attr array is properly applied to the widget of field1.

Since the Twig reference does state that an entire form is a valid argument, I assume this is a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions