如何添加条件> 2018年在symfony的sonata admin中的yaml文件中的过滤变量of blocks语句。
created是表的日期时间类型字段。
sonata_admin.yml
sonata_admin:
dashboard:
blocks:
-
class: col-lg-3 col-xs-6 # twitter bootstrap responsive code
position: top # zone in the dashboard
type: sonata.admin.block.stats # block id
settings:
code: sonata.page.admin.page # admin code - service id
icon: fa-magic # font awesome icon
text: Edited Pages
color: bg-yellow # colors: bg-green, bg-red and bg-aqua
filters: # filter values
createdAt: { value: > 2018 }
我从sonata admin的这个文档中获取了这段代码。 https://symfony.com/doc/master/bundles/SonataAdminBundle/reference/dashboard.html