Customiza Sonata左侧边栏

时间:2015-12-08 14:55:45

标签: symfony sonata-admin sonata

Sonata Admin Area

我想在左侧栏添加这些链接,但我不知道如何:我一直在努力,但没有:(

1 个答案:

答案 0 :(得分:1)

在YourBundle / Resources / config / admin.yml中 添加:

services:
    tabssoft.admin.company:
        class: Tabssoft\CompanyBundle\Admin\CompanyAdmin
        tags:
           - { name: sonata.admin, manager_type: orm, group: "General", label: "Company" }
        arguments:
            - ~
            - Tabssoft\CompanyBundle\Entity\Company
            - TabssoftCompanyBundle:CompanyCRUD
        calls:
            - [ setTranslationDomain, [TabssoftCompanyBundle]]

    tabssoft.admin.job:
        class: Tabssoft\CompanyBundle\Admin\JobAdmin
        tags:
            - { name: sonata.admin, manager_type: orm, group: "General", label: "Job" }
        arguments:
            - ~
            - Tabssoft\CompanyBundle\Entity\Job
            - ~
        calls:
            - [ setTranslationDomain, [TabssoftCompanyBundle]]

然后在imports:下的app / config / config.yml中添加:

- { resource: @TabssoftCompanyBundle/Resources/config/admin.yml }

然后在groups:下的app / config / sonata / sonata_admin.yml中添加:

sonata.admin.group.tabssoft:
    label:           General
    label_catalogue: TabssoftCompanyBundle
    icon:            '<i class="fa fa-th"></i>'
    items:
        - tabssoft.admin.company
        - tabssoft.admin.job

明确可以