Symfony2 // How to organize your bundles

When creating a new project, you probably already asked yourself this question, how can I organize my bundles?

The answer is that there is no standard good practice, it all depends of the nature of your project.

For small projects in which you don’t need to reuse some codes, you can decide to put all your sources in a single “appBundle”.
By against, for bigger projects that are frequently evolving, it is a good practice to organize more properly your bundles.

Usually we proceed like this: one bundle per module and one controller per functionality.
So, you’ll have to clearly identify your modules and make them bundles like this:

- MySiteName
    - UserBundle
        - RegistrationController
        - ChangePasswordController
    - ContactBundle
        - ContactController
    - PaymentBundle
        - PaypalController
        - MoneyBookerController

One advantage of this method is that you could publicly share some bundles to the community in public platforms.

More informations on the official Symfony Doc:

Symfony2 // How to organize your bundles

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s