Symfony 2 multiple apps?

后端 未结 6 1549
灰色年华
灰色年华 2021-01-31 12:06

This appears to be the scariest topic relating to Symfony2, as after a week of searching and testing, I am still unable to find an answer to this.

In short, I am buildin

6条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 12:42

    You can create different configuration using the testing/Dev example :

    Step 1 Create as many web/app.php file as you have subdomain.

    web/app_subdomainx.php
    

    Step 2 In each app_subdomain_X.php file change configuration :

    $kernel = new AppKernel('subdomainx', false);
    

    Step 3 create configuration file matching your environment

    config_subdomainx.yml
    security_subdomainx.yml
    

    Step 4

    acces you specific domain through

    /web/app_subdomainx.php

    PS :

    Keep config.yml for common configuration (like db connection) and include config.yml into config_subdomainx.yml

    imports:
        - { resource: config.yml }
    

提交回复
热议问题