'symfony easyadmin customize field value
i have an Entity Product that has a field category. If i call the list i want to show the name of the Category. If i call edit i want to show the name and the id of the Category in the Options like this
<select>
<option value=<?= $category->getId()?> ><?= $category->getName().' '.$category->getId() ?></option>
</select>
thats my configuration //product.yml
easy_admin:
entities:
Product:
class: CoreBundle\Entity\Product
label: 'admin.entities.product.label'
help: 'admin.entities.product.help'
role: ROLE_ADMIN
disabled_actions:
- 'new'
- 'delete'
list:
title: 'admin.entities.product.list.label'
actions:
-
name: 'configureProduct'
icon: 'bolt'
label: 'admin.entities.product.actions.configure'
fields:
-
property: category
label: 'admin.entities.product.list.fields.category'
edit:
title: 'admin.entities.product.edit.label'
fields:
-
property: category
label: 'admin.entities.product.edit.fields.category'
How can do this.
Thanks in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
