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

[Feature] Image Check Checkbox/Radio Inputs #188

Open
ExtremTechniker opened this issue Mar 21, 2024 · 3 comments
Open

[Feature] Image Check Checkbox/Radio Inputs #188

ExtremTechniker opened this issue Mar 21, 2024 · 3 comments
Labels
Feature Feature requested

Comments

@ExtremTechniker
Copy link

Please add some FormType and form themes to add the Image Check Checkbox and Radio Inputs.

image

image

Form structure should be like the examples from tabler.io
https://tabler.io/docs/forms/form-image-check

@kevinpapst
Copy link
Owner

And I wondered if thosed where ever used outside of the preview. Seems yes 😁

If anyone wants to contribute a PR, please let me know!

@ExtremTechniker
Copy link
Author

Yeah I also thought no one would use it. But I'm helping a colleague with his footpicker an in one form you can pick an restaurant and there will be the logo be displayed.

Would it be possible to add this as an formtype extension because we are using the doctrine entity type which is based on the choice type. And I think all possible choice types should have the possibility to display as image check

@kevinpapst
Copy link
Owner

You need to attach meta data to each entry for the logo url, so the default doctrine entity type is probably the wrong form type. Afair symfony recommends populating the list of entities yourself in such cases.

Just use a normal ChoiceType and set choices = your array of entities.
Then add a form_widget twig block to render the needed html.

@cavasinf cavasinf added the Feature Feature requested label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature requested
Projects
None yet
Development

No branches or pull requests

3 participants