Php 在多个模块中覆盖相同的后台办公室视图
我的功能与 如文档所述,要覆盖模块中的管理模板,我们需要:Php 在多个模块中覆盖相同的后台办公室视图,php,symfony,prestashop-1.7,Php,Symfony,Prestashop 1.7,我的功能与 如文档所述,要覆盖模块中的管理模板,我们需要: 找到正确的模板(使用调试工具栏) 创建相同的路径(modules/mod_name/view/PrestaShop/../…)并添加视图 使用扩展注释参考原始模板 使用块注释引用现有块 基本Hello World示例: // Refer to the original template this the extends annotation. {% extends 'PrestaShopBundle:Admin/Product/Ca
- 找到正确的模板(使用调试工具栏)
- 创建相同的路径(modules/mod_name/view/PrestaShop/../…)并添加视图
- 使用扩展注释参考原始模板
- 使用块注释引用现有块
// Refer to the original template this the extends annotation.
{% extends 'PrestaShopBundle:Admin/Product/CatalogPage:catalog.html.twig' %}
//Refer to an existing block using block annotation.
{% block product_catalog_filters %}
Hello world!
{% endblock %}
所以,好吧,覆盖后台视图就像一种魅力
但让我们想象一下这个用例:
- 我们有一个模块a,它覆盖后台视图并使用 块(例如:块产品目录过滤器)李>
- 我们想安装一个新的模块B,它将覆盖相同的模块 后台视图和同一块(ex:block 产品目录过滤器)