2

I am new to Magento 2. I created a new module using:
Create Basic module Magento 2 - Inchoo

Once it was implemented then by default the module was enabled.
My question is how by default we can disable the module at first. Without the following steps:
1. Without editing app/etc/config.php.
2. Without command line

bin/magento module:disable Test_Helloworld

In Magento 1 we had option to disable a module by default by setting active as false in app\etc\modules\Test_Helloworld.xml. Is this option not exist in Magento 2.

2 Answers 2

2

Well in Magento 1 - When you are creating new module , you actually not running any command to installed/enabled it. Its automatically started working.

While in Magento 2 - Whenever you are preparing any new module - you need to run php bin/magento setup:upgrade command to installed it.

So basically there is not module level settings is available to disabled that module. Magento has replaced that functionality to app/etc/config.php from where you can disabled module manually by changing its status 0 to 1. Or you can disabled it by running command which you mention above.

Even though if you look at Magento Core Modules they have also follows the same structure.

Note : Magento 2 etc/module.xml have only 2 major things are there one is module name and second one is sequence tag which is sometimes necessary.

2
  • @Raghu - Happy to help !! Keep Helping :) Commented Dec 8, 2017 at 13:34
  • 1
    Thanks @ManthanDave for the information.
    – Raghu
    Commented Dec 12, 2019 at 6:18
1

In M2, You can do it by the above two methods only. There is no other method to disable module.

1
  • Thanks @BornCoder.
    – Raghu
    Commented Dec 12, 2019 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.