【发布时间】:2017-01-18 20:23:55
【问题描述】:
我在 app/config.yml 中有以下部分:
bp_image:
types:
user_avatar:
width: 200
height: 200
upload_path: '%kernel.root_dir%/../web/uploads'
在我的 Bundle 配置文件中:
$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"
任何想法我做错了什么?
【问题讨论】: