简体   繁体   English

不能使用奏鸣曲/树枝的模板机制

[英]can't use template mechanism of sonata / twig

I have to custom the sonata_admin_dashboard template on a symfony 4 application. 我必须在symfony 4应用程序上自定义sonata_admin_dashboard模板。

As figured in https://symfony.com/doc/master/bundles/SonataAdminBundle/reference/templates.html , I've created a file config.yaml which contains : https://symfony.com/doc/master/bundles/SonataAdminBundle/reference/templates.html中所示 ,我创建了一个文件config.yaml,其中包含:

sonata_admin:
    templates:
        layout:                         '@App/standard_layout_el.html.twig'
        dashboard:                      '@App/Default/dashboard_el.html.twig' 

I've created the file @App/standard_layout_el.html.twig which begins by 我创建了文件@ App / standard_layout_el.html.twig,其开始于

{% extends '@SonataAdmin/standard_layout.html.twig' %}

and the file @App/Default/dashboard_el.html.twig which begins by 以及以以下内容开头的文件@ App / Default / dashboard_el.html.twig

{% extends '@SonataAdmin/Core/dashboard.html.twig' %}

I've cleaned the cache. 我已经清理了缓存。

But, when I run my application, in the symfony debug toolbar, i can see that the template used is @SonataAdmin/Core/dashboard.html.twig 但是,当我运行应用程序时,在symfony调试工具栏中,我可以看到使用的模板是@ SonataAdmin / Core / dashboard.html.twig

What did I miss ? 我错过了什么 ?

Config.yaml错误:我使用config / packages / sonata_admin.yaml,问题消失了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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