我试图覆盖 EasyAdmin 的"new"模板,但系统忽略模板代码。 这是 easy_admin.yaml
的相关部分entities:
# List the entity class name you want to manage
Places:
class: App\Entity\Places
templates:
list: 'asdfasdf'
如您所见,列表属性的值无效,但系统会忽略它并正常工作,不会出现错误,并且我无法覆盖模板。
你有什么建议吗?
最佳答案
所以,正如我在评论中提到的 - 由于某种原因,如果指定的模板不存在,easyadmin 不会给出任何错误。因此,您只需将新模板放置在 templates
文件夹中,例如 templates/admin/listPlaces.html.twig
,然后在 easyadmin 的配置文件中指定正确的路径,例如:
entities:
Places:
class: App\Entity\Places
templates:
list: 'admin/listPlaces.html.twig'
关于symfony - EasyAdmin 使用您自己的模板问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55148049/