How to add an array with values in Symfony2 configuration?

前端 未结 2 1939
清歌不尽
清歌不尽 2021-02-13 01:42

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:26

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

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

提交回复
热议问题