简介
我有一个简单的表格。
test.iloc[:, 3]['Three] = test.iloc[:, 3]['Three'].fillna('F')
当我用public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add($builder
->create('oneItemToSubmit', TextType::class), array(
'entry_type' => TextType::class,
));
}
提交时,我得到所需的输出,即我的data_class对象正确地保持水分
问题
我想提交一个listOfItems array (["oneItem" => '1'])
数组,并获取一个水合数据的数组_class对象水合正确
array (["listOfItems" => ['1', '2', '3'])
问题
如何使用public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add($builder
->create('listOfItems', CollectionType::class), array(
'entry_type' => TextType::class,
));
}
?
答案 0 :(得分:0)
试试这个:
public function buildForm(FormBuilderInterface $builder, array
$options){
$builder->add($builder
->create('oneItemToSubmit', TextType::class), array(
'class' => CollectionType::class,
'entry_type' => TextType::class,
));
}
答案 1 :(得分:0)
public function buildForm(FormBuilderInterface $builder, array $options){
$builder->add('listOfItems', CollectionType::class, array(
'entry_type' => TextType::class,
'entry_options' => array(
'attr' => array('class' => 'list-box')
),
));
}