我有以下形式的代码:
$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" })}}
但是结果是这样的:
我与检查员一起审查:
出什么问题了?