2015-12-11 70 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的數組。

此註冊信息是最近添加的,未在網上找到很多教程