我在我的奏鸣曲管理员列表菜单中设置了几个实体。其中两个可以正常工作,但是当我添加第三个时,会引发错误。
这只是简单的列表视图,我不知道错误是从哪里来的。
无效的服务“ app.main”:方法“ MainApp \ Base \ Service \ AppService :: setFormTheme()”不存在。
在我的services.yml中:
app.first:
class: MainApp\Base\Service\FirstService
arguments: [~, MainApp\Base\Entity\Client\First, ~]
tags:
- { name: sonata.admin, manager_type: orm, group: First, label: First }
app.second:
class: MainApp\Base\Service\SecondService
arguments: [~, MainApp\Base\Entity\Client\Second, ~]
tags:
- { name: sonata.admin, manager_type: orm, group: Second, label: Second }
app.third:
class: MainApp\Base\Service\ThirdService
arguments: [~, MainApp\Base\Entity\Card\Third, ~]
tags:
- { name: sonata.admin, manager_type: orm, group: Third, label: Third }
以及我的第三项服务:
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->add('one')
->add('two')
->add('three');
}
当我将“ app.third”导入services.yml时,会引发我提到的错误。