0

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…</p>

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.

4

1 回答 1

1

确保您没有覆盖您的设置的重复声明。

如果您的 config.yml 中有以下情况...

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

namespace: ~

...仅加载默认值。


加载和验证配置是两个不同的任务。

您可以在之后不加载时验证完全不同的配置。

只有使用与扩展名匹配的别名时才会加载配置。

getAlias()添加到您的扩展中以对其进行硬编码...

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

...并确保正确加载了扩展程序。

于 2013-06-17T08:58:09.810 回答