odolbeau / phone-number-bundle

Integrates libphonenumber into your Symfony application
MIT License
217 stars 43 forks source link

Possible Way to implement Flags into Form or Twig #105

Closed Hanmac closed 1 year ago

Hanmac commented 2 years ago

I don't know if it would work that easy, but would it be possible to add country flags into the Form?

while searching for phone number features i found this: https://intl-tel-input.com/

might that be able to work with this Symfony Bundle?

Nek- commented 2 years ago

Hello, yes it could work. Many implementations can be done here. I'm not aware of the best practice in including frontend dependencies with Symfony Bundle, but it's definitely possible to do something and that would be super great.

However, there's some work to do here to end up with something cool. Feel free to suggest ways to implement it or purpose a pull request!

Hanmac commented 2 years ago

For Form Fields i found this: https://symfony.com/doc/current/EasyAdminBundle/fields/CountryField.html

i did experiment with Standard Symfony Forms, and pure html forms doesn't support it, so the form theme needs something like jquery ui to replace the Select

Nek- commented 2 years ago

It would be really nice to have something working without jQuery.

Hanmac commented 2 years ago

jquery was just an example, the first link probably works without it

i just mean that it wouldn't be able to work with HTML alone but needs some kind of Javascript

because the <option> doesn't allow any kind of html inside the label

Nek- commented 2 years ago

Yes, you're absolutely right. Feel free to help us with it :) .

maxhelias commented 1 year ago

A PR is open #152 , so I close the issue to centralize exchanges