Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在处理简单的管理列表页面。我有依赖于数据库的字段。如何在 yaml 文件中添加动态字段?这里的季节字段可能会重复取决于数据库
list: title: "test" fields: - { property: name, label: "name" } - { property: season, label: "season" }
在您的实体中添加 getter,如下所示:
public functioin getLowerName(): ?string { return mb_strtolower($this->getNmae(), 'utf-8'); }
向 yaml 添加虚拟字段:
- { property: 'lowerName', label: "Name in lower case" }