【发布时间】:2019-04-20 21:50:28
【问题描述】:
基于 MDB 的此文档: https://mdbootstrap.com/docs/jquery/forms/select/
我已经创建了这个表单
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('categorie', EntityType::class, [
// This field shows all the categories
'class' => Categorie::class,
'Placeholder' => 'Select choice',
'mapped' => false,
'multiple' => true,
'attr' => ['class' => 'mdb-select']
])
就像我编写的代码一样,我想在占位符中看到“选择选项” 但这是图片中的结果:
我的问题是我直接看到类 Categorie 的结果,但首先我需要看到占位符!
请问有什么解决办法吗?
PS:我的问题与此不重复: How to add placeholder on input in Symfony 4 form?
因为我使用的是 MaterialDesignBootstrap 而不是引导程序,所以我使用了占位符,例如该问题的响应,但不起作用。
【问题讨论】:
-
@gp_sflover 没有重复,因为在我的情况下,我使用 MaterialDesignBootstrap 而不是引导程序,我使用的是占位符并且不起作用
标签: javascript twitter-bootstrap symfony symfony4 mdbootstrap