2
votes

Couple of month ago I got a legacy project written on Sf2. I fixed some bugs, and added some new functionality, but still i feel that it was made a little bit clumsy. Well, maybe not just a little :) So, I have a number of questions, how things really should be done in Sf2. The first thing which is bothering me, is that the Application is separated on Frontend and Backend bundles. The're standing on the same model, and for example entity Book can be seen from FrontendBundle and edited from BackendBundle. In some way this is producing a confusion of abstractions. So my question is - is it right, or wrong, and if wrong how it should be done in appropriate way?

1
I think that you have just to ask yourself this question: is bundle reusable? If yes, you're doing it right. If not, you are splitting your app into logical pieces of files and components, and you are right again. - gremo
I think you need to un-accept the provided answer and edit your question, so that it comes to the circle again, seeking for a new well-formed answer, as the accepted one does not really answer the problem. - Pmpr

1 Answers

2
votes

Bundles are components in symfony2 that provides a functionality to your app. The frontend and backend approach has changed in symfony2, the bundles are used instead.

For example, you can create a BookBundle, and put all the functionality regarding to books in that bundle, adding, updating etc. And by configuring the routes, you can redirect all the requests about the book to that bundle.

The main point is, the frontend and the backend about the books resides in same bundle, and only in that bundle(with controllers and entities and repositories and views etc.).

This is the intended usage in symfony2.