Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoComplete] Manually using the Stimulus Controller to pass extra Options to the Autocompleter #2409

Open
toxicity1985 opened this issue Nov 28, 2024 · 1 comment

Comments

@toxicity1985
Copy link

Hello,

I used the stimulus controller to pass some extra data to my autocompleter but i was having issue that my data was not well formatted.
I have to make some extra code to generate the checksum.
So i want to contribute and make something for that but i don't know what's the good way to do that.
I think i have two solutions for that,

  • Create a ux_autocomplete_path function in twig to make the stuff
  • Create a filter to generate the array with the checksum ?
    If you have some other and better solution, say it !

image

@toxicity1985 toxicity1985 added the Bug Bug Fix label Nov 28, 2024
@smnandre
Copy link
Member

If you need to pass extra data, you need to code your own endpoint (some Controller or Kernel EventListener) and handle yourself the hashing / checking of the values

https://symfony.com/bundles/ux-autocomplete/current/index.html#custom-autocomplete-endpoint

To use the extra_options feature, as it is a FormType construct, your form must be rendered with the form system.

@smnandre smnandre added RFC and removed Bug Bug Fix labels Nov 29, 2024
@smnandre smnandre changed the title [AUTOCOMPLETE] Manually using the Stimulus Controller to pass extra Options to the Autocompleter [AutoComplete] Manually using the Stimulus Controller to pass extra Options to the Autocompleter Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants