好的,所以我有一个有两个选项的选择表
$builder->add('type', 'choice', array(
'label' => 'User type',
'choices' => array('1' => 'Customer', '2' => 'Supplier'),
'expanded' => true,
'multiple' => false,
'required' => false,
));
Run Code Online (Sandbox Code Playgroud)
我想使用twig在视图中拆分选项来得到这样的东西:
{{ form_widget(form.type/choice_1/) }}
some html stuf
{{ form_widget(form.type/choice_2/) }}
Run Code Online (Sandbox Code Playgroud)
任何sugestions?