answer of @michael-sivolobov is very Good.
But, I want to add more clarity in answering the Question:
Are you planning on sharing this bundle across multiple applications?
[no]:
The Symfony Bundle generator needs to decide the useage of the generated bundle.
If this question is answered with yes
: That means your generated Bundle will be Used "as is" with multiple projects, not Just for your current project, so you need to prefix a "vendor" name for your generated bundle, and also add the prefix to the namespace of the generated bundle.
Upon not following the convention, a message will print from the Console which reads:
Each bundle is hosted under a namespace (like Acme/BlogBundle). The
namespace should begin with a "vendor" name like your company name,
your project name, or your client name, followed by one or more
optional category sub-namespaces, and it should end with the bundle
name itself (which must have Bundle as a suffix).
See Best Practice for Bundle Name for more details on bundle
naming conventions.
Use / instead of \ for the namespace delimiter to avoid any problem.
File structure for the generated Bundle under src/
dirctory will Be:
├─ src/
│ └─ yourVendor/
│ └─ yourBundle/
│ └─ Controller/
│ └─ DependencyInjection/
│ └─ Resources/
│ └─ Tests/
│ └─ yourVendorYourBundle.php/
If you answer this question with a No
: This means you intend to use your generated Bundle only for your Current Project, so you do not need the "vendor" name as the prefix as it is never going to be shared.
File structure for the generated Bundle under src/
dirctory will Be:
├─ src/
│ └─ yourBundle/
│ └─ Controller/
│ └─ Resources/
│ └─ Tests/
│ └─ yourBundle.php/
Here is some good documentation on Best Practices for creating projects .