How to add an array with values in Symfony2 configuration?

前端 未结 2 2105
长发绾君心
长发绾君心 2021-02-13 02:12

I would like to add a simple list of values in a configuration files (config.yml). For example :

my_bundle:
    columns: [\"col1\", \"col2\"]

W

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-13 02:19

    If you want to achieve a node like this, just do:

    $rootNode
        ->children()
            ->arrayNode('columns')
                ->prototype('scalar')
                ->end()
            ->end()
        ->end()
    ;
    

提交回复
热议问题