I am building an extension to load config files from all installed bundles.
my Extension looks like this:
namespace Acme\\MenuBundle\\DependencyInjection;
That's because your code:
$rootNode = $treeBuilder->root('mw_menu');
$rootNode
->children()
->scalarNode('mw_menu')->defaultValue('')->end()
->end();
means that the config file should look like this:
mw_menu:
mw_menu: "some teststring"
To be more specific, you need to adapt your code to whatever node you want. In general, people use a general root, like mw_menu
, and then secondary value like database_driver
in the following example:
$rootNode = $treeBuilder->root('mw_menu');
$rootNode
->children()
->scalarNode('database_driver')->defaultValue('orm')->end()
->end();
Which would then look like this in config file:
mw_menu:
database_driver: mongo_db