19 declare(strict_types=1);
46 $countries = array_combine($countries, array_map($this->
translatedCountry(...), $countries));
48 return $this->
ui->create()->input()->field()->group([
49 'country' => $this->
ui->create()->input()->field()->select(
50 $this->
ui->txt(
'country'),
52 )->withRequired(
true, ($this->required)($countries))->withValue(strtoupper($arguments[
'country'] ??
'') ?: null)
53 ], $this->
ui->txt(
'crit_type_usr_country'), $this->
ui->txt(
'crit_type_usr_country_info'));
58 return new UserCountry($criterion, $this, $this->
ui->create());
63 return $this->
ui->txt(
'crit_type_usr_country');
68 return $this->
ui->txt(
'meta_c_' . strtoupper($country));
formGroup(array $arguments=[])
translatedCountry(string $country)
__construct(private readonly UI $ui, private readonly Closure $required)
withCriterion(CriterionContent $criterion)
static getCountryCodes()
Get country codes (DIN EN 3166-1)