【发布时间】:2021-05-26 09:28:53
【问题描述】:
我正在关注这里的文档:https://docs.sulu.io/en/2.2/cookbook/smart-content-data-provider.html
尝试为我的自定义实体类型“MatchEvent”制作自定义数据提供者:
我按照这里的解释做了。因为我有 services.yaml 文件,所以我定义了这两个:
app.match_event_repository:
class: App\Repository\MatchEventRepository
factory: ['@doctrine', 'getRepository']
arguments:
- Symfony\Bridge\Doctrine\ManagerRegistry
app.smart_content.data_provider.matchevent:
class: App\SmartContent\MatchEventDataProvider
arguments: ['@app.match_event_repository', '@sulu_core.array_serializer', '@request_stack' ]
tags: [{name: 'sulu.content.type', alias: 'smart_matchevent_selection'}]
所以,如果我理解得很好,之后我应该有我的自定义内容数据提供程序,命名为“smart_matchevent_selection”,我可以像这样使用它:
<property name="match" type="smart_content">
<meta>
<title lang="en">Match</title>
<title lang="de">Match</title>
</meta>
<params>
<param name="provider" value="smart_matchevent_selection"/>
</params>
</property>
但是当我尝试编辑包含此字段的页面时,我收到错误:
Sulu\Bundle\PreviewBundle\Controller\PreviewController 中缺少参数标记
在project/vendor/sulu/sulu/src/Sulu/Bundle/PreviewBundle/Controller/PreviewController.php: 处触发异常:
public function stopAction(Request $request): Response
{
$this->preview->stop($this->getRequestParameter($request, 'token', true));
return new JsonResponse();
}
我在这里做错了什么?
【问题讨论】:
标签: sulu