Magento2升级脚本从模块阵列中删除模块

时间:2015-12-11 14:21:54

标签: php magento magento2 magento-2.0

我有我的模块配置

应用程序/代码/ SET /的HelloWorld / etc.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    
    <router id="standard">
    
        <route id="helloworld" frontName="helloworld">
    
            <module name="SET_HelloWorld" />
    
        </route>
    
    </router>
    
</config>
       

并将其添加到etc / config.php中:

'SET_HelloWorld' => 1,

但是在运行bin/magento setup:upgrade之后,te config.php数组中的密钥消失了。

有人可以告诉我为什么吗?

1 个答案:

答案 0 :(得分:2)

我发现我错过了Registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'SET_HelloWorld',
    __DIR__
);

如果模块未注册,magento会自动将其从config.php数组中删除。

此注册最近已添加,但未在网上教程中找到

相关问题