本文介绍了我要打包什么? (Symfony 2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以我要使用symfony 2创建一个网站。

Oke so I am about to make a website using symfony 2.

我应该制作一个主捆绑包来控制/组合所有其他捆绑包吗?
我想到的是与其他捆绑销售商品捆绑销售的图库捆绑销售商品,以及控制商店零件的商店捆绑销售商品。

Should I just make a "main" bundle that controls/puts together all other bundles?With other bundles I am thinking of lets say a "gallery" bundle that controls things related to photos, and a "store" bundle that controls a shop part.

什么是最佳(或至少是好的)实践,专业团队将如何做?

What would be best (or atleast good) practice and how would professional teams do it?

推荐答案

根据symfony文档a捆绑包应保持一致且封闭。因此,例如,如果商店和图库以某种方式关联(例如,使用相同的模型),则它们应该在一个捆绑包中(AppBundle,CoreBundle,PlatformBundle-随便什么)。但是,如果Gallery是完全独立的代码,并且可以轻松地加入另一个项目-那么您应该考虑将其排除在单独的捆绑软件之外。

According to symfony documentation a bundle should be consistent and closed structure. So, if for example "store" and "gallery" are related in some way (eg. use the same model), then they should be in one bundle (AppBundle, CoreBundle, PlatformBundle - whatever you want). But if gallery is completely separate piece of code and can be easily join to another project - then you should consider exclude it to separate bundle.

我认为一个不错的主意是在github上的一些项目中,看看其他项目如何处理。

I think a good idea is look at some projects on github and look how others handle this.

这篇关于我要打包什么? (Symfony 2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 00:33