Skip to content

[Form] Collection: Reorganization of the lower part of the page #13454

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

Closed
ThomasLandauer opened this issue Mar 30, 2020 · 3 comments
Closed

[Form] Collection: Reorganization of the lower part of the page #13454

ThomasLandauer opened this issue Mar 30, 2020 · 3 comments
Labels

Comments

@ThomasLandauer
Copy link
Contributor

ThomasLandauer commented Mar 30, 2020

I'm suggesting to reorganize the page, starting at Allowing "new" Tags with the "Prototype"¶ https://symfony.com/doc/current/form/form_collections.html#allowing-new-tags-with-the-prototype

  • Merge the "add" and the "remove" sections. (Almost) anybody needing "add" will need "remove" too. And it just doesn't make sense to show a full code block again, just to explain another tiny adjustment needed for "remove". It's way easier to show it all at once, maybe with some inline comments like "this is only needed for removing tags"

  • Organize the two Doctrine boxes differently: Start with the most common relationship type. IMO this is "One-To-Many, Bidirectional" https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/association-mapping.html#one-to-many-bidirectional . Then explain what's different if you're using one of the other relationship types.

  • Do not show a full JavaScript working example. Why? First, this makes it a nightmare to maintain. I tried some changes elsewhere, then realized the implications on the various JavaScript code blocks and got stuck: Changing the "jQuery" part #13450 (comment) That's probably the reason why this page hasn't changed for years - the code is so intertwined that nobody dares touching it.
    Second: It is so unlikely that anybody uses the exact same setup (jQuery with ul), that copy-pasting won't work anyway. And the Symfony docs are no JavaScript tutorial.
    Solution: Just show this single line (since it's the only part that's really demanded by Symfony), and explain the rest in comments or pseudo-code (or maybe some Fiddles):

    newForm = newForm.replace(/__name__/g, index);
@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@carsonbot
Copy link
Collaborator

Friendly reminder that this issue exists. If I don't hear anything I'll close this.

@carsonbot
Copy link
Collaborator

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

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