문제

I want to access the object being edited within a sonata admin edit form. Something like:

{% for prop, value in admin.getDatagrid(object.id) %}
<li>value</li>
{% endfor %}

How can I access the object's data?

도움이 되었습니까?

해결책

I had to do this:

{% for item in object.items()%}
<li>{{item.id}}</li>
{% endfor %}

'object' accesses the entity directly and I have a getItems method on the entity

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top