简体   繁体   English

Symfony 2 generate:bundle-有或没有命名空间/ Bundle /

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

I'm new to Symfony. 我是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). 我浏览了有关Symfony 2的文档和最新教程。创建捆绑软件时,文档始终会像路径(包括中间的“捆绑软件”文件夹)那样告诉使用“供应商/捆绑软件/博客捆绑软件”。 But when I'm reading most of the tutorials they have used 'Vendor/BlogBundle' like path (not include a 'Bundle' folder). 但是,当我阅读大多数教程时,他们都使用了“ Vendor / BlogBu​​ndle”之类的路径(不包括“ Bundle”文件夹)。 So can anybody explain the purpose of using separate 'Bundle' folder to store bundles under the Vendor folder. 因此,任何人都可以解释使用单独的“捆绑包”文件夹将捆绑包存储在Vendor文件夹下的目的。

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. 如果您的ComponentBridge或任何其他库在相同的供应商名称空间下,则命名空间中的额外Bundle主要用于结构化。 Eg like symfony framework itself . 例如喜欢symfony框架本身

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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