I have the following configuration:
my_project:
options:
key1: value1
key2: value2
key3: value3
key4: [sub1, sub2, sub3, sub4]
These options are not known by my extension, I would like to get an associative array:
array(
"key1"=>"value1",
"key"=>"value2",
"key3"=>"value3",
"key4"=>array("sub1","sub2","sub3","sub4")
);
My tree looks like:
$rootNode
->addDefaultsIfNotSet()
->children()
->arrayNode('options')
->useAttributeAsKey('key')
->treatNullLike(array())
->prototype('scalar')->end()
->end()
->end();
The problem is that with the key/value "key4" I have an exception (this is normal as the prototype is 'array').
So my question is : How can I mix both scalar and array options?