We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I couldn't find it in the docs: How do I display the country code and identification in the drop down when choosing a widget 'country_choice' ?
I know this could be changed in the Misd\PhoneNumberBundle\Form\Type\PhoneNumberType at line 68 as follow:
Misd\PhoneNumberBundle\Form\Type\PhoneNumberType
foreach (Intl::getRegionBundle()->getCountryNames() as $region => $name) { if (false === isset($countries[$region])) { continue; } $countryChoices[sprintf('%s (+%s)', $region, $countries[$region])] = $region; }
But I was wondering if there isn't a cleaner way to do this
~thoroc
The text was updated successfully, but these errors were encountered:
This could be solved by merging the following PR: #90
Sorry, something went wrong.
for ref, once the PR is merged, the label can be used as follow:
$builder ->add('telephoneNumber', PhoneNumberType::class, [ 'widget' => PhoneNumberType::WIDGET_COUNTRY_CHOICE, 'country_choices' => ['DE', 'CH', 'AT'], 'country_widget_label' => function($countries, $name, $region){ return sprintf('%s (+%s)', $region, $countries[$region]); }, 'preferred_country_choices' => ['DE'], ... ]) ;
No branches or pull requests
Hi,
I couldn't find it in the docs: How do I display the country code and identification in the drop down when choosing a widget 'country_choice' ?
I know this could be changed in the
Misd\PhoneNumberBundle\Form\Type\PhoneNumberType
at line 68 as follow:But I was wondering if there isn't a cleaner way to do this
~thoroc
The text was updated successfully, but these errors were encountered: