-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Better explain the mandatory/convention location of some elements #6616
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
Changes from 4 commits
c521227
fe86c35
e7d72ed
a53277e
4145ed5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,22 +115,23 @@ them under the ``cache/`` or ``log/`` directory of the host application. Tools | |
can generate files in the bundle directory structure, but only if the generated | ||
files are going to be part of the repository. | ||
|
||
The following classes and files have specific emplacements: | ||
|
||
=============================== ============================= | ||
Type Directory | ||
=============================== ============================= | ||
Commands ``Command/`` | ||
Controllers ``Controller/`` | ||
Service Container Extensions ``DependencyInjection/`` | ||
Event Listeners ``EventListener/`` | ||
Model classes [1] ``Model/`` | ||
Configuration ``Resources/config/`` | ||
Web Resources (CSS, JS, images) ``Resources/public/`` | ||
Translation files ``Resources/translations/`` | ||
Templates ``Resources/views/`` | ||
Unit and Functional Tests ``Tests/`` | ||
=============================== ============================= | ||
The following classes and files have specific emplacements (some are mandatory | ||
and others are just conventions followed by most developers): | ||
|
||
=============================== ============================= ================ | ||
Type Directory Mandatory? | ||
=============================== ============================= ================ | ||
Commands ``Command/`` Yes | ||
Controllers ``Controller/`` Yes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this one mandatory? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just checked. This is not mandatory. |
||
Service Container Extensions ``DependencyInjection/`` Yes | ||
Event Listeners ``EventListener/`` No | ||
Model classes [1] ``Model/`` No | ||
Configuration ``Resources/config/`` Yes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit tricky. Apparently Symfony doesn't mandate this dir ... but bundles such as DoctrineBundle assume that |
||
Web Resources (CSS, JS, images) ``Resources/public/`` Yes | ||
Translation files ``Resources/translations/`` Yes | ||
Templates ``Resources/views/`` Yes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Unit and Functional Tests ``Tests/`` No | ||
=============================== ============================= ================ | ||
|
||
[1] See :doc:`/cookbook/doctrine/mapping_model_classes` for how to handle the | ||
mapping with a compiler pass. | ||
|
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.
technically, not fully (mandatory only for auto-registration, but we have tag-based registration since 2.4)
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.
Yeah, that applies to about 99% of the mandatory elements in this table. That's why I started to dislike documenting these. But I think it'll help if we document the default way for beginners.
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 agree (see my comment above).
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.
What if we revert this change and add a short cookbook article explaining how to override all of these locations?
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.
Are we sure it's worth it? How often do you need to do that? And if you have the need, won't you probably experienced enough to figure that out yourself?
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 it's that easy. For example: how do you put the translations in
<your-bundle>/translations/*
instead of<your-bundle>/Resources/translations/
or the templates in<your-bundle>/templates/*
instead of<your-bundle>/Resources/views/*
?