Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Formtypes should be placed in Form\Type-Directory#5695
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
zatikbalazs commentedSep 20, 2015
Yes, according to the Symfony Book you should put them in the |
xabbuh commentedSep 23, 2015
👍 Though we have two |
HKandulla commentedSep 24, 2015
@xabbuh: I am not sure what two use statements you mean. Can you give me the lines? |
xabbuh commentedSep 24, 2015
@HKandulla Sorry, I missed the fact that you already tackled them. |
xabbuh commentedSep 27, 2015
@HKandulla Can you also add the filename comments like started in#5727? |
Included hint about file location for Controller- and View-Files.
HKandulla commentedSep 28, 2015
@xabbuh: Good idea. I added the filename comments to all files (Formtype, Controller and Views). Additionally I changed the namespace for the example Controller from "AppBundle\Controller\Admin" to "AppBundle\Controller" to use standard directory order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't think we need this here (it does not really matter how your controller is named and we actually omit most of the class already for readability). Though I would now move theuse statement below the placeholder comment.
wouterj commentedOct 9, 2015
I'm not sure I'm 100% behind this PR. A major goal of the best practices guide is to make everything simpler and quicker to write. That's why templates have been moved to For the same reason, I would argue that the On the other side, things can get out of hand pretty quickly when having a form type, extension and listener. It's also consistent with the internal Form component extension organization. So I'm leaning a bit towards -0.4 for using Anyway, as always a huge thanks to you for putting time into making the Symfony documentation more consistent! It's great you noticed this inconsistency, it's just a matter of deciding the practice. |
javiereguiluz commentedOct 9, 2015
@wouterj here it is the discussion I had with@weaverryan about this issue:symfony/demo#6 |
HKandulla commentedOct 9, 2015
Personally, I like to keep FormTypes in an own directory, especially when you start to put more/all busines logik into one Bundle. But I leave it up to you. Let me know, than I can do the changes xabbuh pointed out before you merge. |
weaverryan commentedNov 11, 2015
The Symfony best practices are to put them in the My vote is to keep it in |
wouterj commentedDec 21, 2015
As there seems to be a general vote to not place form types in In order to make things more clear and explicitly tell people that this is not a hard rule (nothing in the docs is btw), I've created a new PR adding a best practice box for the form type namespace:#6059 🎄 |
No description provided.