2015-12-11 67 views
1

Ive得到了我的模块配置Magento2升级脚本删除模块进行模块阵列的

应用程序/代码/ 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>
  

而且在加入这等/ config.php文件:

'SET_HelloWorld' => 1, 

但是运行后bin/magento setup:upgrade config.php数组中的键不见了。

有人能告诉我为什么吗?

回答

2

我发现我错过了和registration.php

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

如果模块没有注册,Magento的自动删除它的config.php的数组。

此注册信息是最近添加的,未在网上找到很多教程