0

我正在处理简单的管理列表页面。我有依赖于数据库的字段。如何在 yaml 文件中添加动态字段?这里的季节字段可能会重复取决于数据库

 list:
       title: "test"
       fields:
           - { property: name, label: "name" }
           - { property: season,  label: "season" }
4

1 回答 1

0

在您的实体中添加 getter,如下所示:

public functioin getLowerName(): ?string
{
    return mb_strtolower($this->getNmae(), 'utf-8');
}

向 yaml 添加虚拟字段:

- { property: 'lowerName',  label: "Name in lower case" }
于 2020-01-20T15:28:41.740 回答