Symfony ChoiceType $choices - labels and values swapped
问题 Symfony 2.8.2 According to the Symfony docs "The choices option is an array, where the array key is the item's label and the array value is the item's value" http://symfony.com/doc/2.8/reference/forms/types/choice.html#choices But with the following form I'm seeing the exact opposite: $filterForm = $this->createFormBuilder() ->add('vendorName', ChoiceType::class, array( 'expanded' => true, 'multiple' => true, 'choices' => array('label' => 'value') // <-- HERE )) ->add('filter', SubmitType: