简体   繁体   中英

Symfony 2 generate:bundle - with or without namespace /Bundle/

I'm new to Symfony. I went through the documentation and recent tutorials about Symfony 2. When creating a bundle, documentation always tells use to "Vendor/Bundle/BlogBundle" like path (including middle 'Bundle'folder). But when I'm reading most of the tutorials they have used 'Vendor/BlogBundle' like path (not include a 'Bundle' folder). So can anybody explain the purpose of using separate 'Bundle' folder to store bundles under the Vendor folder.

Thanks

If you take a look at How to use Best Practices for Structuring Bundles you can see, both methods are common. An extra Bundle in the namespace if mostly used for structuring if you have Component s, Bridge s or any other libraries under the same vendor name space. Eg like symfony framework itself .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM