自定义奏鸣曲左侧边栏
Posted
技术标签:
【中文标题】自定义奏鸣曲左侧边栏【英文标题】:Customiza Sonata left sidebar 【发布时间】:2016-03-13 13:20:57 【问题描述】:我想在左侧边栏中添加这些链接,但我不知道如何:S 我一直在尝试但没有:(
【问题讨论】:
How to change the "sonata project" link in SonataAdmin?的可能重复 【参考方案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]]
然后在app/config/config.yml下imports:
添加:
- resource: @TabssoftCompanyBundle/Resources/config/admin.yml
然后在app/config/sonata/sonata_admin.yml下groups:
添加:
sonata.admin.group.tabssoft:
label: General
label_catalogue: TabssoftCompanyBundle
icon: '<i class="fa fa-th"></i>'
items:
- tabssoft.admin.company
- tabssoft.admin.job
清除缓存
【讨论】:
当我使用整个奏鸣曲项目时这很好,但我只使用奏鸣曲 adminBundle以上是关于自定义奏鸣曲左侧边栏的主要内容,如果未能解决你的问题,请参考以下文章