删除表格行symfony/twig中的表格控制 [英] delete form-control in form-row symfony/twig
本文介绍了删除表格行symfony/twig中的表格控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我创建此生成器时
$builder
->add('categorie', EntityType::class, [
// This field shows all the categories
'class' => Categorie::class,
'mapped' => false,
'multiple' => true,
'attr' => ['class' => 'mdb-select']
])
当我执行 form_row(form.name)
我看到班级自动具有值'form-control',但是我使用的是MDBootstrap,我只想设置 mdb-select
i see class has value 'form-control' automaticaly, but me i'm use MDBootstrap and i want to set only mdb-select
推荐答案
它是由引导4主题.
It is caused by one of the default form themes of Symfony, I think by default currently it's the bootstrap 4 theme.
要在整个应用中消除该类,您可以更改默认表单主题,例如形成div布局:
To get rid of that class across the whole app you can change the default form theme, e.g. to form div layout:
# config/packages/twig.yaml
twig:
form_themes: ['form_div_layout.html.twig']
# ...
文档还描述了如何在较小范围内删除该类.
The documentation also describes how to remove the class in smaller scope.
这篇关于删除表格行symfony/twig中的表格控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文