Possibility to override the label in country widget#90
Conversation
By passing in a closure into the form options it's possible to customize the way the label of the country field is formatted:
|
Imo you should then also set the allowed types for this option to |
|
@xabbuh Thanks for your feedback. I wasn't even sure if this is the right way to do it? I will check the required types thing you mentioned |
| $countryChoices[$options['country_widget_label']($countries, $name, $region)] = $region; | ||
| } else { | ||
| $countryChoices[sprintf('%s (+%s)', $name, $countries[$region])] = $region; | ||
| } |
There was a problem hiding this comment.
@xabbuh Is a default sprintf() call okay, in order to get rid off the else branch?
There was a problem hiding this comment.
Where would you place that sprintf() call?
|
What happened with this PR? can it be merged? |
|
@thoroc I forgot it to be honest. I will look into it tonight. Thanks for the reminder |
|
@mablae @xabbuh @thewilkybarkid any chances of merging this? |
|
Sorry for the delay in looking at this. We'll need some test coverage before merging. |
|
@xabbuh @thewilkybarkid BUMP Please check this issue for merge as soon is possible, it is a nice feature could customize the label or even the class (the test coverage should be pretty simple) |
|
I just see to that the template https://github.com/misd-service-development/phone-number-bundle/blob/master/Resources/views/Form/tel_bootstrap.html.twig is not picket the default merge params in composed widget that should be useful. For example in twig I have to hard customize as following via form.phone.country and via form.phone.number: |
|
Any update on this? Seem to have a conflict in the PhoneNumberType? |
|
Smth new about this issue? |
|
Maybe we should finally write the tests? |
|
@mablae @xabbuh @thewilkybarkid any update with this? would be nice to have it merged |
|
Any news? |
By passing in a closure into the form options it's possible to customize the way the label of the country field is formatted: