I encounter a problem when I want to create a custom template for the creation and editing view of my entity.
Unable to find template "AppBundle:Admin:Estate:edit.html.twig" (looked into: C:\wamp64\www\ibg\vendor\knplabs\knp-menu\src\Knp\Menu/Resources/views, C:\wamp64\www\ibg\vendor\symfony\symfony\src\Symfony\Bridge\Twig/Resources/views/Form).
Services.yml
app.admin.estate:
class: AppBundle\Admin\EstateAdmin
tags:
- { name: sonata.admin, manager_type: orm, label: "Biens immobiliers" }
arguments:
- ~
- AppBundle\Entity\Estate
- ~
calls:
- [ setTemplate, [edit, AppBundle:Admin/Estate/edit.html.twig]]
public: true
I tested lot's of syntaxe for setTemplate but always the same message
- [ setTemplate, [edit, AppBundle:Admin:Estate:edit.html.twig]]
- [ setTemplate, [edit, AppBundle:Admin/Estate:edit.html.twig]]
- [ setTemplate, [edit, AppBundle/Resources/views/Admin/Estate/edit.html.twig]]
or
The service "app.admin.estate.template_registry" has a dependency on a non-existent service "App/Admin/Estate:edit.html.twig".
When I use
- [ setTemplate, [edit,"@App/Resources/views/Admin/Estate/edit.html.twig"]]
- [ setTemplate, [edit,"@App/Admin/Estate/edit.html.twig"]]
- [ setTemplate, [edit,"@App\Admin\Estate\edit.html.twig"]]
The path of my twig file is src\AppBundle\Resources\views\Admin\Estate\edit.html.twig
I don't understand ... I have an old project with sonata and symfony and it work well
- [ setTemplate, [edit, AppBundle:Admin/Exemple:exemple.html.twig]]
Sonata admin version 3.40.2
Symfony 3.4.17
Thank you for your help.