当前位置 : 主页 > 网页制作 > xml >

xml – 如何将此文件转换为yml?

来源:互联网 收集:自由互联 发布时间:2021-06-13
如何将此文件转换为yml? container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/servic
如何将此文件转换为yml?

<container xmlns="http://symfony.com/schema/dic/services"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
        <services>
           <service id="sonata.admin.course" class="YourNS\AdminBundle\Admin\BlogAdmin">
              <tag name="sonata.admin" manager_type="orm" group="Posts" label="Blog"/>
              <argument />
              <argument>YourNS\AdminBundle\Entity\Course</argument>
              <argument>SonataAdminBundle:CRUD</argument>
              <call method="setTranslationDomain">
                  <argument>YourNSAdminBundle</argument>
              </call>
          </service>
       </services>
    </container>
像这样的东西(我没试过):

services:
  sonata.admin.course:
    class: YourNS\AdminBundle\Admin\BlogAdmin
    arguments: [null, YourNS\AdminBundle\Entity\Course, 'SonataAdminBundle:CRUD']
    calls:
        - [setTranslationDomain, YourNSAdminBundle]
    tags:
        - { name: sonata.admin, manager_type: orm, group: Posts, label: Blog }
网友评论