Skip to content

Commit

Permalink
core-2275 choices as values, flipped choices
Browse files Browse the repository at this point in the history
  • Loading branch information
stereomon committed Jan 25, 2018
1 parent 4dce67d commit dd181ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Spryker/Zed/Customer/Communication/Form/AddressForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ protected function addSalutationField(FormBuilderInterface $builder, array $choi
$builder->add(static::FIELD_SALUTATION, ChoiceType::class, [
'label' => 'Salutation',
'placeholder' => 'Select one',
'choices' => $choices,
'choices' => array_flip($choices),
'choices_as_values' => true,
]);

return $this;
Expand Down Expand Up @@ -257,7 +258,8 @@ protected function addFkCountryField(FormBuilderInterface $builder, array $choic
$builder->add(static::FIELD_FK_COUNTRY, ChoiceType::class, [
'label' => 'Country',
'placeholder' => 'Select one',
'choices' => $choices,
'choices' => array_flip($choices),
'choices_as_values' => true,
'preferred_choices' => $preferredChoices,
'constraints' => [
new NotBlank(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ protected function addDefaultBillingAddressField(FormBuilderInterface $builder,
$builder->add(self::FIELD_DEFAULT_BILLING_ADDRESS, ChoiceType::class, [
'label' => 'Billing Address',
'placeholder' => 'Select one',
'choices' => $choices,
'choices' => array_flip($choices),
'choices_as_values' => true,
'required' => false,
]);

Expand All @@ -96,7 +97,8 @@ protected function addDefaultShippingAddressField(FormBuilderInterface $builder,
$builder->add(self::FIELD_DEFAULT_SHIPPING_ADDRESS, ChoiceType::class, [
'label' => 'Shipping Address',
'placeholder' => 'Select one',
'choices' => $choices,
'choices' => array_flip($choices),
'choices_as_values' => true,
'required' => false,
]);

Expand Down

0 comments on commit dd181ae

Please sign in to comment.