如何在easyadmin包中显示价值作为标题?

时间:2018-04-18 16:54:57

标签: symfony symfony-3.3 symfony2-easyadmin easyadmin

在config.yml

edit:
                title:  'editing %firstname% '
                fields:
                    - {property: firstname, type: string}
                    - {property: lastname, type: string}
                    - {property: email, type: string}
                    - {property: password,type: password}
                    - {property: mobilenumber, type: string}
                    - enabled

我希望用户名动态显示,%firstname%不起作用。

1 个答案:

答案 0 :(得分:0)

您只能在编辑视图中显示实体ID,如下所示:

title: 'editing %%entity_id%%'

从那里开始,您可以使用Doctrine复合主键在User key的主键中包含firstname(或username?):

/** @ORM\Id @ORM\Column(type="string") */
private $username;