2lenet/easyadmin-plus-bundle
EasyAdminPlus provides custom form types.
This type allows you to make an autocomplete field like the easyadmin's one, but with customizable URL meaning that you can get autocomplete data from other websites/APIs with AJAX calls. This uses the JQuery's select2.
Configure the the property you want to autocomplete in easyadmin YAML:
- { property: 'my_property', type: 'Lle\EasyAdminPlusBundle\Form\Type\UrlAutocompleteType', type_options: {'url': 'https://core.nathyslog.com/service.core/services-json', 'value_filter':'service_name'} }
In type options, you have:
EasyAdmin already provides autocomplete URLs for the configured entities, and those can be sufficient most of the time.
Their pattern is: https://www.example.com/admin/?action=autocomplete&entity=Entity
Note that "admin" can be named something else in some projects.
If you need to make more specific researches that easyadmin can't provide, you need to make your own autocomplete route. It has to return JSON.
Request queries are: (in GET)
Result is an array composed of:
Example:
{
"results":
[
{
"id": "161",
"text": "Something to select"
},
{
"id": "314",
"text": "Something else"
}
],
"has_next_page": false
}
How can I help you explore Laravel packages today?