easy_admin:
entities:
User:
class: App\Entity\User
disabled_actions: ['new']
avatar_property_path: 'picture'
form:
fields:
- {property: 'rank'}
- { property: 'roles',
type: choice,type_options: { mapped: true, expanded: true, multiple: true},
choices: [role_admin: 'ROLE_ADMIN' , role_user: 'ROLE_USER'] }
this is the code that i wrote and this is the result :
you should do like this instead of form
easy_admin:
entities:
User:
class: App\Entity\User
disabled_actions: ['new']
avatar_property_path: 'picture'
new:
fields:
- {property: 'rank'}
- { property: 'roles',
type: choice,type_options: { mapped: true, expanded: true, multiple: true},
choices: [role_admin: 'ROLE_ADMIN' , role_user: 'ROLE_USER'] }
edit:
fields:
- {property: 'rank'}
- { property: 'roles',
type: choice,type_options: { mapped: true, expanded: true, multiple: true},
choices: [role_admin: 'ROLE_ADMIN' , role_user: 'ROLE_USER'] }