下拉菜单<select>中的默认值(符号)

时间:2019-07-26 18:29:42

标签: symfony twig symfony-forms symfony-3.3 symfony3.x

我有以下形式的代码:

$formShipping->add('shippingType', EntityType::class, array('mapped' => false, 'required' => true,'placeholder' => 'Select a shipping method', 'label' => 'Shipping Method', 'class' => 'BackendBundle\Entity\Shipping', 'choice_label' => 'shipdesc',
                'query_builder' => function (EntityRepository $er) {
                    return $er->createQueryBuilder('s')
                        ->where('s.active = :active')
                        ->orderBy('s.shipdesc', 'ASC')
                        ->setParameter('active', true);
                }, 'attr' => array('class' => 'form-control')));

这是树枝中的代码:

{{ form_row(form.shippingType, {value: "1" })}}

但是结果是这样的:

enter image description here

我与检查员一起审查:

enter image description here

出什么问题了?

0 个答案:

没有答案
相关问题