Why would I make a bunch? (Symfony 2)

Oke, so I'm going to make a site using symfony 2.

Should I just create a “core” package that manages / merges all the other packages? With other bundles, I’m thinking about saying “gallery”, which controls things related to photos, and “shop”, which controls part of the store.

What would be the best (or at least good) practice and how will professional teams do this?

+7
source share
3 answers

According to the Symfony documentation, a package must be consistent and closed. So, if, for example, the “store” and “gallery” are somehow connected (for example, they use the same model), then they should be in the same package (AppBundle, CoreBundle, PlatformBundle - everything you want). But if the gallery is a completely separate part of the code and can be easily attached to another project, then you should consider excluding it for a separate package.

I think a good idea is to look at some projects on github and see how others deal with this.

+3
source

See the following questions and their answers:

Basically, in my recent projects I do not use packages for specific application code; the only exception is for things that are hard-coded in a bunch - like the Doctrine Fixtures that I introduced in the AppBundle . Everything else - models, controllers, services, types of forms, etc. - from any package.

+2
source

As @Cyprian said, a collection is a collection of functions that can work alone. How this happens during development, we do not always know when everything is separate. He comes with time.

I personally have been working with Symfony2 since February, and I never stopped reading the manual and related books to understand them in more detail. It helped a lot and is very interesting to read, I assure you :)

Here is my top page for select documentation, enlightening blog posts on delicious ones .

For your immediate question, forget about the "frontend" and "backend", as we did in symfony 1.x. Just think about the model objects (as in the SINGLE line) and build in one set. As your code grows, you will see how to parse and separate it in bundles. You just have to keep your functions in mind in small methods and a refactor.

+1
source

All Articles