0
votes

I wrote many Symfony 2.2 bundles. At the begening, they were in the src/ directory. For a new project, I moved them to the vendor directory.

They need to be configured by using config.yml setting file. The Dependency Injection Configuration file of the main bundle validates de config.yml structure but does not load the settings: it loads the default configuration…

vendor/myFirm/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/Configuration.php https://wall.deblan.org/x1805/php/1/configuration-php

vendor/myFirm/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/TrinityContentManagerExtension.php https://wall.deblan.org/x1806/php/1/TrinityContentManagerExtension-php

app/config/config.yml wall.deblan.org/x1808/yaml/0/

When I put a var_dump($config) TrinityContentManagerExtension.php, I just have the default values set in Configuration.php.

Could you help me please?

PS: I don't have the same problem with the others.

1
how do your settings look in config.yml ? make sure you don't have a dublicate declaration overwriting them lateron - Nicolai Fröhlich

1 Answers

1
votes

make sure you don't have a dublicate declaration overwriting your settings.

If you have i.e. the following situation in your config.yml ...

namespace:
    setting1: value1
    setting2: value2
    # .. more settings

namespace: ~

... only the defaults will be loaded.


loading and validating configuration are two different tasks.

you can validate a completely different configuration while it's not being loaded afterwards.

configuration will only be loaded if it uses an alias matching an extension.

add getAlias() to your Extension in order to hardcode it...

public function getAlias()
{
   return 'trinity_content_manager';
}

... and make sure the Extension is properly loaded.