How to convert symfony yaml config files to xml format?

后端 未结 3 1551
谎友^
谎友^ 2021-01-06 01:51

I\'d like to hold symfony config and routing files as XML files. I know, there are many code examples in the symfony-book but not all configurations-types are shown.

3条回答
  •  灰色年华
    2021-01-06 02:40

    The Symfony2 package (2.4.0) contains yml type files for their AcmeDemoBundle. It is a hassle to change those existing yml files. However, you can make a little modifications that make your newly created bundles use xml format config and routing. You can modify /app/config/config.yml

    # resource: "%kernel.root_dir%/config/routing.yml"
    resource: "%kernel.root_dir%/config/routing.xml"
    

    Also, /app/config/routing_dev.yml

    # resource: routing.yml
    resource: routing.xml
    

    By doing these changes, you can choose to use xml when you build your own bundles.

提交回复
热议问题