1
我在應用程序/ config.yml以下部分:Symfony3配置TreeBuilder作爲
bp_image:
types:
user_avatar:
width: 200
height: 200
upload_path: '%kernel.root_dir%/../web/uploads'
在我的包的配置文件
我:
$rootNode = $treeBuilder->root('bp_image');
$rootNode
->fixXmlConfig('type')
->children()
->arrayNode('types')
->requiresAtLeastOneElement()
->useAttributeAsKey('name')
->prototype('array')
->children()
->variableNode('width')->end()
->variableNode('height')->end()
->variableNode('upload_path')->end()
->end()
->end()
->end()
->end();
當我嘗試處理配置的Symfony拋出以下異常:
InvalidConfigurationException in ArrayNode.php line 317:
Unrecognized option "user_avatar" under "bp_image"
任何想法我做錯了什麼?