Symfony配置中的多维数组

时间:2016-03-10 04:30:56

标签: yaml

所以我有以下配置:

shinobi_ui:
application_title: "PILIPINAS"
modules:
    - { name: dashboard, submodules}
    - { name: general }

如何在每个{}中放入另一个数组。

让我们说子模块是这样的数组:

 submodules:
    - { name: submodule in dashboard }
    - { name: another submodile}

那么我该如何实现这样的配置?

由于

1 个答案:

答案 0 :(得分:0)

只需添加内联:

shinobi_ui:
application_title: "PILIPINAS"
modules:
    - { name: dashboard, submodules: [{ name: submodule in dashboard }, { name: another submodile}]}
    - { name: general }

或者让它成为多线:

shinobi_ui:
application_title: "PILIPINAS"
modules:
    - name: dashboard
      submodules:
          - { name: submodule in dashboard }
          - { name: another submodile}
    - name: general