我有一个用于设置mysql,sqlite和postgre配置的表单。我将它们安排在不同的标签上(使用bootstrap)。同样,我有一个表单字段:连接类型(有三个选项)。为此,我使用选择字段类型。
如何为数据库的每个标签创建一个单选按钮?
答案 0 :(得分:2)
您需要在choice
字段中将expanded
选项设置为true。
例如,在表单中键入:
$builder->add('connection_type', 'choice', array(
'choices' => array('MySQL' => 'mysql', 'SQLite' => 'sqlite', 'PostgreSQL' => 'postgresql'),
'expanded' => true,
));