8000 [Form] Choice children can be template customized like collection by adrienbrault · Pull Request #9033 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Choice children can be template customized like collection #9033

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

Merged
merged 1 commit into from
Sep 25, 2014

Conversation

adrienbrault
Copy link
Contributor
Q A
Bug fix? no
New feature? yes
BC breaks? yes?
Deprecations? no
Tests pass? No ?
Fixed tickets
License MIT
Doc PR None

I wanted to customize the template of a children of a choice field. I learned it was not currently possible, though it is with the collection type. So this should let people be able to customize the template for all the choice children at once.

Ie:

{% block _user_colors_entry_widget %}

Still have to fix the tests

@adrienbrault
Copy link
Contributor Author

Okay, I found how to fix the broken tests. I now just have to write new tests for my change.

@adrienbrault
Copy link
Contributor Author

Btw @bschussek what do you think about this change ?

@webmozart
Copy link
Contributor

Does it work just like this? Can you add a test case? We also need to check the performance implications. I think they shouldn't be too bad though, because expanded choice fields are not usually used for long choice lists.

@adrienbrault
Copy link
Contributor Author

I've added a test.

Tests are broken but it does not seem to come from my changes.

@fabpot
Copy link
Member
fabpot commented Sep 23, 2014

@webmozart Looks like it's mergeable, no?

@webmozart
Copy link
Contributor

Awesome, thanks @adrienbrault! :)

@webmozart webmozart merged commit 4e6b27f into symfony:master Sep 25, 2014
@webmozart
Copy link
Contributor

Could you please open a docs PR?

webmozart added a commit that referenced this pull request Sep 25, 2014
…collection (adrienbrault)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[Form] Choice children can be template customized like collection

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes?
| Deprecations? | no
| Tests pass?   | No ?
| Fixed tickets |
| License       | MIT
| Doc PR        | None

I wanted to customize the template of a children of a choice field. I learned it was not currently possible, though it is with the collection type. So this should let people be able to customize the template for all the choice children at once.

Ie:

```jinja
{% block _user_colors_entry_widget %}
```

Still have to fix the tests

Commits
-------

4e6b27f [Form] Choice children can be template customized like collection
@weaverryan
Copy link
Member

I opened up an issue symfony/symfony-docs#4270 so we don't lose this. Thanks!

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

Successfully merging this pull request may close these issues.

4 participants
0