Pregunta

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?

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top