如何在magento2的前端布局xml文件中启用或禁用模块[关闭]

问题描述 投票:-1回答:1

我已经为前端创建了js文件和default_head_blocks.xml。现在,我想在default_head_blocks.xml文件中获得system.xml文件的启用或禁用功能。结论是如果启用了模块,则在default_head_blocks.xml中,否则将运行js文件代码。“如何执行?

magento magento2 magento-2.0 magento2.2
1个回答
0
投票

禁用模块的最佳方法是使用config.php文件而不是XML

您必须将1文件中的值从0更改为app/etc/config.php

禁用Magento_Version模块的示例:

<?php
return [
    'modules' => [
        ...
        'Magento_Version' => 0,
        ...
    ]
];
© www.soinside.com 2019 - 2024. All rights reserved.