I'm trying to create a folder structure like described in Different Directories per Environment:
- app
- config
- common
- config.yml
- routing.yml
- dev
- config.yml
- routing.yml
This does work pretty well for all files (config.yml, parameters.yml etc.) but nor for config.yml.
I get this error:
The routing file "[…]" contains unsupported keys for "imports": "0". Expected one of: "resource", "type", "prefix", "pattern", "path", "host", "schemes", "methods", "defaults", "requirements", "options", "condition".
What I've done so far:
appKernel.php
public function registerContainerConfiguration(LoaderInterface $loader) {
$loader->load($this->getRootDir().'/config/'.$this->getEnvironment().'/config.yml');
}
routing.yml in dev
#app/config/dev/routing.yml
imports:
- { resource: ../common/routing.yml }
config.yml in common
#app/config/common/config.yml
imports:
- { resource: 'parameters.yml' }
- { resource: 'security.yml' }
- { resource: 'services.yml' }
framework:
router:
resource: "%kernel.root_dir%/config/common/routing.yml"
config.yml in dev
#app/config/dev/config.yml
imports:
- { resource: '../common/config.yml' }
- { resource: 'parameters.yml' }
- { resource: 'security.yml' }
- { resource: 'services.yml' }
framework:
router:
resource: "%kernel.root_dir%/config/dev/routing.yml"
What did I miss here?