Alesandro Torosidis
Alesandro Torosidis

Reputation: 11

Symfony: load config by subdomain

How can I load custom config for subdomain in Symfony 3, for ex:
red.color.net:


    -ColorBundle
    --Resources
    ---config
    ----red.yml
    ----green.yml
    ----blue.yml

blue.color.net:


    -ColorBundle
    --Resources
    ---config
    ----red.yml
    ----green.yml
    ----blue.yml

Upvotes: 1

Views: 158

Answers (1)

Rafal Kozlowski
Rafal Kozlowski

Reputation: 760

In file

app/AppKernel.php

You have a method

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

You can modify its body to load any configuration file you need

Upvotes: 3

Related Questions