如何编辑Symfony 5,EasyAdmin 4中的主菜单标签?
我正在使用Symfony EasyAdmin 4 ,无法弄清楚如何更改主菜单的实体标签。他们默认为实体的名称。
这似乎可以使用 EasyAdmin 2.x 可以实现,因为旧文档显示。但是,那里没有提到的文件(translations.xx.yaml
,config/packages/easy_admin.yaml
)仍在 easyadmin 4.x 4.x 。
那么,如何在EasyAdmin中编辑主菜单标签?
I am using Symfony EasyAdmin 4 and couldn't figure out how to change the main menu's entities' labels. They default to their entities' name.
This seems easily achievable with EasyAdmin 2.x, as the old docs show. But none of the files mentioned there (translations/messages.xx.yaml
,config/packages/easy_admin.yaml
) is still in use in EasyAdmin 4.x.
So, how to edit the Main Menu Labels in EasyAdmin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们不需要
easyAdmin 4
中的任何这些文件:这可以通过简单地实现
setEntityLabelinsingular
和setEntityLabeLInplural
中的方法来实现。 configurecrud
相关CRUD控制器内部的方法:不要忘记:
使用EasyCorp \ Bundle \ EasyAdminBundle \ config \ config \ crud \ crud \ crud;
在此处: symfony:快速轨道
We don't need any of those files in
EasyAdmin 4
:This can be achieved by simply implementing
setEntityLabelInSingular
andsetEntityLabelInPlural
methods inside theconfigureCrud
method inside the concerned crud controller:Don't forget the :
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
More here: Symfony: The Fast Track