SyliusCmsPlugin
SyliusCmsPlugin copied to clipboard
[Autocomplete] What is the purpose of `choice_name` and `choice_value`?
Thanks for this plugin.
I'm sorry in advance if my question is not relevant. I just started learning Sylius and using this plugin last week. Please feel free to tell me and close the issue.
I'm asking this question because when digging in the code to understand how the autocomplete works, I found those fields in the template: https://github.com/BitBagCommerce/SyliusCmsPlugin/blob/v3.2.2/src/Resources/views/Form/theme.html.twig#L19-L20
I found those field seems to be needed in the js file: https://github.com/BitBagCommerce/SyliusCmsPlugin/blob/v3.2.2/src/Resources/assets/admin/js/bitbag/bitbag-media-autocomplete.js#L12-L13
They are not used anywhere in the file.
My understanding is that those fields may be there to allow some customizations but it's not clear how.
Thanks in advance for the response.
I think best is to have a look at the Symfony docs about these features:
- https://symfony.com/doc/current/reference/forms/types/choice.html#choice-value
- https://symfony.com/doc/current/reference/forms/types/choice.html#choice-name
Looks like fully explained.