I'm trying to generate the detail route for an entity in a twig file with this code:
{{ path('admin', { crudAction: 'detail', entity: 'Client', entityId: client.id }) }}
but it moves me to the root dashboard page. I noticed that if I insert manually also crudId, copying it from another route, it works. But how can I find the crudId for the detail action when I'm in a twig file?
EasyAdmin has a twig helper function for that:
{% set url = ea_url()
.setDashboard('App\\Controller\\Admin\\DashboardController')
.setController('App\\Controller\\Admin\\ClientCrudController')
.setAction('detail') %}
Docs here:
https://symfony.com/doc/current/bundles/EasyAdminBundle/crud.html#generating-crud-urls
Thanks, it works
Most helpful comment
EasyAdmin has a twig helper function for that:
Docs here:
https://symfony.com/doc/current/bundles/EasyAdminBundle/crud.html#generating-crud-urls