SonataAdminBundle custom group icon

此生再无相见时 提交于 2019-12-12 16:11:46

问题


I'm using SonataAdminBundle to generate a CRUD for my Page entity.

With the yaml file bellow the menu is displayed in the sidebar.

I would like to change the group default icon which is "fa fa-folder".

But I don't find the option to do it.

sonata.admin.page:
        class: FM\AppBundle\Admin\Page\Page
        tags:
            - { name: sonata.admin, manager_type: orm, group: "CMS", label: "Pages" }
        arguments:
            - ~
            - FM\AppBundle\Entity\Page\Page
            - ~

回答1:


"icon" option:

icon: "<i class=\"fa fa-folder\"></i>"

In your example:

sonata.admin.page:
        class: FM\AppBundle\Admin\Page\Page
        tags:
            - { name: sonata.admin, manager_type: orm, group: "CMS", label: "Pages", icon: "<i class=\"fa fa-folder\"></i>" }
        arguments:
            - ~
            - FM\AppBundle\Entity\Page\Page
            - ~


来源:https://stackoverflow.com/questions/36569887/sonataadminbundle-custom-group-icon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!