Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misusage of attr field option #291

Closed
derpue opened this issue Aug 16, 2014 · 0 comments
Closed

Misusage of attr field option #291

derpue opened this issue Aug 16, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@derpue
Copy link
Contributor

derpue commented Aug 16, 2014

The attr option of the formfields is misused to set arbitrary data to control the rendering in the template (input_group, simple_col, col_size and so on).
Besides semantically wrong (there should only be attributes for the rendered markup in it) it also breaks html validation since (at least with the current template, eg: {% block widget_attributes %}) all values in the attr option array are rendered as markup attributes.

Symfony doesn't allow arbitrary fields options as long as they are not defined in a Type or Extension, so i assume thats the reason.

So i Propose an FormExtension which just adds an (array) option, where we could put all the arbitrary data in which is needed by the templates. Thus getting a clean separation and we also won't every time need a new Type or Extension if we need a new option (unless this options needs other options set behind the scenes, like #290, but thats a different thing)

If that Extension is done, we should rewrite the template, but that WILL break backwards compatibility.

You thoughts on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants