简体   繁体   English

在树枝模板中获取管理员和对象ID(奏鸣曲管理员)

[英]Get admin and object id in a twig template (sonata admin)

How do i get the id of the admin and object in a twig template using sonata admin? 如何使用Sonata Admin在树枝模板中获取admin和对象的ID?

I have tried admin.getId() and object.getId() but that didn't work. 我已经尝试了admin.getId()和object.getId(),但是没有用。

Any ideas? 有任何想法吗?

{{ admin.id }} or {{ object.id }}?

Are you sure the admin and object variables are objects? 您确定admin和object变量是对象吗?

Look at this page: http://twig.sensiolabs.org/doc/functions/attribute.html . 查看此页面: http : //twig.sensiolabs.org/doc/functions/attribute.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM