我已阅读 Magento 的 DevDocs 并在 Google 上搜索过这个问题,但通常缺少 registration.php
答案在这里不适用。
我在发布的 CE 2.0.0 版本上,我只是想在 magento/vendor/
中启用我的第一个最小测试模块但
bin/magento module:enable -c Tchsl_Test
结果是:
Unknown module(s): 'Tchsl_Test'
我基于
vendor/magento/
中模块的命名约定和文件位置在
vendor/tchsl/module-test/etc/module.xml
我有<config xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Tchsl_Test" />
</config>
在
vendor/tchsl/module-test/registration.php
我有<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Tchsl_Test',
__DIR__
);
我错过了什么?
最佳答案
我遇到了同样的问题,经过一番修修补补,发现我们的模块实际上属于 app/code/Tchsl/Test/
.将你的模块文件移到那里,然后运行 shell 命令 module:status
应该显示您禁用的模块。
关于magento-2.0 - Magento 2.0 未知模块 : error when enabling custom module from command line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34203342/