EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Trying to retrieve current entity name in an overrided twig template

Open arukado-sama opened this issue 11 years ago • 3 comments

Hello!

I'm trying to retrieve the current entity name in the layout.html.twig file I override. Before the update I was using "_entity.name" and it worked, but it doesn't work anymore. If possible I want to retrieve it in string format to compare it with an other string (with {{ 'expression' in 'string' }}).

Thanks in advance!

arukado-sama avatar May 11 '15 07:05 arukado-sama

Nevermind, I solved the issue! Can be useful so I give here the solution: app.request.get('entity') to retrieve entity name in string format

arukado-sama avatar May 11 '15 07:05 arukado-sama

Look at this example , you can get it with the _entity_config var

Pierstoval avatar May 11 '15 07:05 Pierstoval

In fact this is what I used, sort of, thanks!

arukado-sama avatar May 11 '15 07:05 arukado-sama