在版本<2.3中,属性
data-prototype="{% filter escape %}{% include 'ManaClientBundle:Member:member_prototype.html.twig' with {'form': form.members.get('prototype')} %}{% endfilter %}"
Run Code Online (Sandbox Code Playgroud)
允许原型显示为一行单元格.当然,在2.3中,这一行会产生错误
对象"Symfony\Component\Form\FormView"的方法"get"不存在
根据UPGRADE-2.1.md,不推荐使用get.它不能被建议的变量替换,因为它会产生类似的错误.我怎样才能(轻松?)像以前一样在2.3中渲染原型?运用
data-prototype="{{ form_widget(form.members.vars.prototype)|e }}"
Run Code Online (Sandbox Code Playgroud)
无论twig的资源:表格如何,无论div或表设置如何,都无法提供有用的解决方案.
<tr id="member-form">
<td><input class="smallform" type="radio" name="household[isHead]" value="__name__"></td>
<td>{{ form_widget(form.include, {'attr': {'class':'smallform'}}) }}</td>
<td>{{ form_widget(form.fname, {'attr': {'class':'smallform'}}) }}</td>
<td>{{ form_widget(form.sname, {'attr': {'class':'smallform'}}) }}</td>
<td>{{ form_widget(form.dob, {'attr': {'class':'smallform'}}) }}</td>
<td>{{ form_widget(form.sex, {'attr': {'class':'smallform'}}) }}</td>
<td>{{ form_widget(form.ethnicity, {'attr': {'class':'smallform'}}) }}</td>
<td><a id="removeTr" class="smallbutton" href="#" onclick="removeTr(this)">Remove</a>
Run Code Online (Sandbox Code Playgroud)
geo*_*eoB 11
替换form.members.get('prototype')
为form.members.vars.prototype
.
本来可以更清楚地做什么,但少于无限的猴子找到了解决方案.
归档时间: |
|
查看次数: |
3334 次 |
最近记录: |