Closed
Description
I've created TestFormType
class TestType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('choice', 'choice', ['choices' => ['foo', 'bar']]);
}
public function getName()
{
return 'test';
}
}
created the form in the controller and passed to the view
class DefaultController extends Controller
{
public function indexAction(Request $request)
{
return $this->render('AppBundle::index.html.php', [
'form' => $this->createForm('test')->createView(),
]);
}
}
rendered in the view
<?php echo $view['form']->widget($form['choice']) ?>
and I got this:
<select id="test_choice" name="test[choice]">
<option value="0" id="test_choice" name="test[choice]" required="required">foo</option>
<option value="1" id="test_choice" name="test[choice]" required="required">bar</option>
</select>
Options have the same attributes as select. Options shoud not have them.
I'm working on the latest version of 2.7 branch