SF2: allow the user to configure the package without checking any part of the package configuration

I am actually developing a symfony 2 suite. I would like to allow the user to configure their package with the DIC without checking any part of the package configuration.

For example, the user sets this configuration:

root_node:
    node:
        key1: value1
        key2: value2
        key3: value3

And my configuration package is installed as follows:

$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('root_node');

$rootNode
    ->children()
        ->arrayNode('node')->children()->end()
    ->end();

I would like the child nodes to be configured by the user without checking the package configuration. I do not know how to change the configuration for this problem.

+5
source share
1 answer

symfony2 github . , , :

$rootNode
    ->children()
        ->arrayNode('node')
            ->useAttributeAsKey('node')->prototype('scalar')->end()
        ->end()
    ->end();
+3

All Articles