简体   繁体   中英

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?

I have tried admin.getId() and object.getId() but that didn't work.

Any ideas?

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

Are you sure the admin and object variables are objects?

Look at this page: http://twig.sensiolabs.org/doc/functions/attribute.html .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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