尝试访问信息中心时出现以下错误。
在呈现模板期间抛出了异常("管理服务" app.admin.post"在管理池中找不到。")
我使用本教程"" 5.3.2。使用config.yml""我不知道为什么会有这个错误 https://symfony.com/doc/current/bundles/SonataAdminBundle/reference/dashboard.html
sonata_admin:
templates:
dashboard: SonataAdminBundle:Core:dashboard.html.twig
dashboard:
groups:
app.admin.group.content:
label: app.admin.group.content
label_catalogue: AppBundle
items:
- app.admin.post
app.admin.group.blog:
items: ~
item_adds:
- sonata.admin.page
roles: [ ROLE_ONE, ROLE_TWO ]
app.admin.group.misc: ~
答案 0 :(得分:0)
您是否按照相同的教程声明了服务?
services:
app.admin.post:
class: AppBundle\Admin\PostAdmin
tags:
- name: sonata.admin
manager_type: orm
group: "app.admin.group.content"
label: "app.admin.model.post"
label_catalogue: "AppBundle"
arguments:
- ~
- AppBundle\Entity\Post
- ~
请记住,你必须将它们声明到app / config / services.yml或几乎进入你的src / {whateverBundle}} / Resources / services.yml