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 8753627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:27:50+00:00 2026-06-13T13:27:50+00:00

I’m sure this is easy, but I’m totally stuck here. I’m using sf2 to

  • 0

I’m sure this is easy, but I’m totally stuck here.

I’m using sf2 to make a site with multiple “applications”, but I want a mainpage to display some kind of index of them and I’m not sure on how to do this. Let’s think of this example (actually, it’s not what I’m doing but we could use this):

I have a page for some video game consoles (for now, PS3, 360, WII, PSV and NDS). They will be located in sites like ps3.domain.com, 360.domain.com, nds.domain.com and so on. Every one of them is actually different in it’s logics, they are not clones (one “app” for every one of them), they are mostly independent, except for the core and the user/community stuff, which they are sharing. But in http://www.domain.com or just domain.com, I need to have links to all of them, and I’m not sure where to put this, or how to make a “global” controller above all others.

Could somebody help me?

  • 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-06-13T13:27:50+00:00Added an answer on June 13, 2026 at 1:27 pm

    If your applications are really different, here how I’d do:

    Structure:

    // src/:
        Sybio\Bundle\CoreBundle // Shared entities, config and tools
        Sybio\Bundle\PortalBundle // Your main portal, domain.com
        Sybio\Bundle\Ps3Bundle // Ps3 bundle
        Sybio\Bundle\XboxBundle // Xbox bundle
        // etc ...
    

    Perhaps a better thing, add all console bundles inside a “Console” repository:

    Sybio\Bundle\CoreBundle // Shared entities, config and tools
    Sybio\Bundle\PortalBundle // Your main portal, domain.com
    Sybio\Bundle\Console\Ps3Bundle // Ps3 bundle
    Sybio\Bundle\Console\XboxBundle // Xbox bundle
    // etc ...
    

    CoreBundle is used to share entities between the other bundles, but not only: it will be the bundle that contains specific part of templates that are include on all bundles.

    After, you create one web controller per console:

    web/app.php // Your main site
    web/app_ps3.php // Ps3 app
    web/app_xbox.php // Xbox app
    // etc...
    

    See inside app_ps3.php, replace the first param of AppKernel constructor by the name of the console:

    // ...    
    $kernel = new AppKernel('ps3', false);
    // ...
    

    You can duplicate each controller in dev version if you want, like app_dev.php…

    Now, the framework will load different environment depending of the used webcontroller.

    For example, your domain “ps3.domain.com” will use web/app_ps3.php (we will see how to do that at the end).

    The framework will load the config of the app in app/AppKernel.php:

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
    

    If the visitor hit web/app_ps3.php, the framework will load config_ps3.yml instead of the classical config_dev.php or config_prod.php. You’ll now play with bundle dependencies !

    Create for each console a “app/config_myconsole.php” and also a “app/routing_myconsole.yml”.

    In config_ps3.yml (and other consoles), load your general config:

    // config_ps3.yml
    imports:
        - { resource: config.yml }
    

    After this line override the routing inclusion for ps3 routing file:

    // config_ps3.yml
    
    // ...
    
    framework:
        router:
            resource: "%kernel.root_dir%/config/routing_ps3.yml"
    

    To resume, if a user hit web/app_ps3.yml, the file config_ps3.yml is loaded, then the general config.yml file, then routing_ps3.yml (which replace routing.yml).

    You can also just import the config of the wanted bundle, for each config file, this can lighten the load if you have many bundles:

    // config_ps3.yml
    imports:
    - { resource: config.yml }
    - { resource: "@SybioCoreBundle/Resources/config/services.yml" }
    - { resource: @SybioPs3Bundle/Resources/config/services.yml }
    

    Each console application used is own routes, and also some shared routes and actions located in CoreBundle.

    For each application, you need to load its console routes and the corebundle routes, here an example of routing_ps3.yml:

    // routing_ps3.yml:
    SybioCoreBundle:
        resource: "@SybioCoreBundle/Controller/"
        type:     annotation
        prefix:   /
    
    SybioPs3Bundle:
        resource: "@SybioPs3Bundle/Controller/"
        type:     annotation
        prefix:   /
    

    If the user hit web/app_ps3.yml, routes from Ps3Bundle and CoreBundle are loaded…
    If the user is on http://ps3.domain.com/, il will hit the route “/” from Ps3Bundle, and not the route “/” from another console or from the portal bundle, because you don’t load them !

    If you’ve got a generic page, like “/stats/”, that is shared between all applications, just create this route in CoreBundle, so that you don’t have to duplicate the code on each bundle. As you included CoreBundle routes with Ps3Bundle, the framework will search the route in both bundles.

    This route will be accessible here: ps3.domain.com/stats/, xbox.domain.com/stats/…

    To finish, the last thing you need to do is to use the right webcontroller depending on the subdomain, here how to process:

    // web/.htaccess
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        # Hit ps3 app
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{HTTP_HOST} !^ps3\.domain.com$ [NC]
        RewriteRule ^(.*)$ app_ps3.php [QSA,L]
    
        # Hit xbox app
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{HTTP_HOST} !^xbox\.domain.com$ [NC]
        RewriteRule ^(.*)$ app_xbox.php [QSA,L]
    
        # Hit your main portal
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{HTTP_HOST} !^www\.domain.com$ [NC]
        RewriteRule ^(.*)$ app.php [QSA,L]
    
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ app.php [QSA,L]
    </IfModule>
    

    I’m not really comfortable with vhosts, but normally it works !

    So that’s it, you know how to play with different config to load different applications built on the same core !

    Cheers.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to construct a data frame in an Rcpp function, but when I
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

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.