我需要实现基于评论评分的自定义评论排序,我已经完成了14-customizing_tree_sorting.mdmy app/config.yml
中的services:
如下
# app/config/config.yml
services:
demoBundle.comment.sorter.score:
class: DemoBundleBundleSortingCommentOrderSorting
tags:
- { name: fos_comment.sorter, alias: score }
在这里,SortingInterfac
的重写方法没有在我的自定义类CommentOrderSorting
中调用,我需要实现我的逻辑
Thanks in ad .
我认为你也应该创建配置与您的自定义排序器:
# app/config/config.yml
fos_comment:
service:
sorting:
default: score