Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5930339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:32:31+00:00 2026-05-22T14:32:31+00:00

This might be an obvious thing to you but – even after reading through

  • 0

This might be an obvious thing to you but – even after reading through a lot of manuals and blogs – I’m still not sure what exactly should a bundle in Symfony2 represent in a webpage. And it’s hard to guess it from the simple demo applications.

For example: I have a site which is divided into two parts (one is just a 2nd level domain like example.com and another is dom2.example.com). Each of these two parts has some sections of it’s own – sometimes the same (like news) sometimes different.

What would the correct representation of this in symfony2? Should I have

  • a MySite\site1 and MySite\site2 bundle and do the different sections via different controllers, or
  • bundles Site1\News and Site2\News, or
  • bundles MySite\Site1News and MySite\Site2News etc.

…or am I getting all wrong at this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:32:32+00:00Added an answer on May 22, 2026 at 2:32 pm

    I am also new to Symfony and will follow the results of this question with interest, but for what it’s worth, my take on it is:

    A bundle is just that: a group of files, assets, PHP classes and methods, tests, etc. The logic of the grouping can be anything you like. In some cases, it’s really obvious what the grouping is and why it’s been done — for instance, if I wrote a blog system for Symfony2 and wanted to release it, I’d make it into a bundle. That’s the sort of example used most in the documentation.

    But you’d also use bundles for anything you wanted to release as one little feature. Say for instance, this bundle which creates default routes for all your controllers. It’s not a fully developed plugin/feature like a blog or forum, but it’s a bit of code that I can easily import into my project, it stays totally separate from everything else, it’s a bundle.

    Finally, you’d also use bundles internally to your project, in absolutely any way which makes sense to you.


    My take on your specific situation:

    Quick and easy:

    • MySite\MyCode — gets the job done, and maybe you don’t have any logical way to break up the code you’re going to write.

    If there’s some more unique features between the two sites and you want to separate them out for clarity:

    • MySite\SharedFeatures
    • MySite\Site1Features
    • MySite\Site2Features

    If you really like everything in its place, or if you have a complex project, maybe:

    • MySite\MySiteMain (shared features and catch-all miscellany that doesn’t deserve its own bundle)
    • MySite\News
    • MySite\Site1FeatureSomethingOrOther
    • MySite\Site2FeatureSomethingOrOther

    I definitely think you want to stick to logical groups of code — so I think your example “bundles Site1\News and Site2\News” and “MySite\Site1News and MySite\Site2News” wouldn’t be the best way to go. Site1 and Site2 are implementations, so making a separate bundle for each site’s news page would seem to be counterproductive to me; you’d want to make one news component and build it to be used in two different ways.

    As for your two-domains question, you can either point both domains at the same code, and test within your code for what domain is being requested, or you can check out two copies of the same code and change the configuration files slightly (this doesn’t necessarily violate the idea of DRY because you’d still edit the code in one place, then update both copies.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, this might be obvious but its not clicking quite yet. I am creating
This might seem obvious but I've had this error when trying to use LINQ
(This might be a obvious question but I wasn't sure what to ask Bing/Google)
I'm new to iPhone development and Xcode, so this might be really obvious. I
This might seem like a stupid question I admit. But I'm in a small
This might be on the discussy side, but I would really like to hear
This might be a bit on the silly side of things but I need
This might sound like a little bit of a crazy question, but how can
This might be an odd question, but when I scale my image in C#
This might be a stupid question but if there's a better or proper way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.