This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.


Discuss Symfony 2 bundles here


by Niraghuana » Sun Nov 25, 2012 6:32 pm

Hi Guys,

I am a freshman. Just crawled the cookbook and 100 Pages of the Symfony Book.

Now I'd like to start building my app. Which should be just a simple SocialApp where people can create profiles, upload content like pictures, write messages etc.
I want to build this not because of publishing it, but just to learn how to use symfony.

For me as a beginner it is really hard to know when to build a bundle, when to write only a controller etc.

So the question I got is, is it best practice to have a UserBundle? If so, what should be in there? A Controller for Create, Update, Delete the User? A Controller for the Profile (Place of Birth, Gender, etc. (data which is not really neccessary to have an user account) or is it better to have a Profile Bundle? Where does the security aspects play a roll? Do I have to write security code in my User Controller? Or can the firewall use functions of the Controller to decide whether a user is allowed to access content which is only visible for him?

Yes I have heard about FosUserBundle...but I think it's too big for me and would confuse me a lot more...and maybe would lead to security issues, because I could missuse it...

I hope you got my problem, as it is that I don't really know hoch to structure things in Bundles and Controllers, maybe you could help me out and outline a Structure for the Example of an SocialPlatform like a lightform of Facebook. I mean that would really help me out to get ideas of how to structure things.

Thanks a lot.
Junior Member
Posts: 1
Joined: Sun Nov 25, 2012 6:19 pm

Re: Bundle-Structure

by tiagojsag » Fri Nov 30, 2012 10:33 pm


Let me just say that I did read that you don't want to use FosUserBundle. Still, give it a try. Even if, in the end, you think it's too big (it's not, by the way) for a small app, what you will learn from using it and browsing the code will help you go much further than just reading the docs. The same goes for most of the bundles you'll find out there: Knp, Sonata, Liip, etc, all of those have a large user base and great people developing them, which means you'll see some nice jedi-like php and sf2 tricks in the code.

Anyway, it's just a suggestion

Tiago Garcia

Core Web Developer @ Shopware
User avatar
Faithful Member
Posts: 885
Joined: Wed Aug 10, 2011 4:58 pm