0
我试图获得pagerfanta结果的字段名。树枝和pagerfanta获取fieldname和fieldname.value
嫩枝模板
{% for post in posts %}
{{ dump(post) }}
{% endfor %}
转储结果是:
Users {#764 ▼
-iduser: 11
-username: "xzvdsfg"
-password: "SHHHHHH"
-lastlogin: DateTime {#691 ▶}
-roles: []
}
我想每个条目的名称,而不知道它在一个表中放置这样
<table>
<thead>
<th>{{ fieldname }}</th>
</thead>
<tbody>
<td>{{ fieldname.value }}</td>
</tbody>
</table>
并得到这个结果
<table>
<thead>
<th>username</th>
</thead>
<tbody>
<td>xzvdsfg</td>
</tbody>
</table>
我是新的树枝模板 谢谢!