I would like to know if there is any way to put null
value by default in the easyadmin_autocomplete select.
The first item in the list is selected and filled with data from database but i need a null
value by default and setted automaticly. The goal is a first result point to an empty one (Choose one...).
Do you know how to do it?
Can you think of any way combining the options defined below?
#easy_admin.yml
Product:
class: App\Entity\Product
controller: App\Controller\ProductController
new:
fields:
- { property: 'category', label: 'Category', type: 'easyadmin_autocomplete', type_options: { class: 'App\Entity\Category' } }
}
In this example, one select has a placeholder
with the text 'Any' (Ninguno). I need to know why is handling them different.
These are the options defined for the attr fields -> type_options of the
yml
:
- action
- allow_extra_fields
- allow_file_upload
- attr
- auto_initialize
- block_name
- by_reference
- class
- compound
- constraints
- csrf_field_name
- csrf_message
- csrf_protection
- csrf_token_id
- csrf_token_manager
- data
- data_class
- disabled
- empty_data
- error_bubbling
- error_mapping
- extra_fields_message
- help
- help_attr
- inherit_data
- invalid_message
- invalid_message_parameters
- label
- label_attr
- label_format
- mapped
- method
- multiple
- post_max_size_message
- property_path
- required
- translation_domain
- trim
- upload_max_size_message
- validation_groups