如何在symfony 2中设置呈现字段的名称属性?symfony 2表单字段的设置名称属性
预期输出:
<input type="text" name="test" value="test" />
渲染场这样
{{ form_widget(form.test, { 'attr': {'name': 'test'} }) }}
肯定是行不通的。
产出仍然
<input type="text" name="form[test]" value="test" />.
有什么办法来设置的name属性和id属性的动态?谢谢。
请参阅http://stackoverflow.com/questions/8416783/symfony2-form-component-creating-fields-without-the-forms-name-in-the-name-att – max