我想在添加和编辑期间在复选框中显示数据库值
这是我的代码,它在组合框中显示值
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('role', 'entity', array(
'class' => 'DashboardAdminManageUserBundle:role',
'property' => 'title',
'multiple' => true,
'query_builder' => function(EntityRepository $er) {
return $er->createQueryBuilder('g');
},
'label' => 'Role*:',
'by_reference' => false,
'required' => false,
));
}
那么如何在 Checkbox 中显示相同的值呢?