As we know, we need to create a custom module in magento2 to override or impliment new feature in magento.

So in this tutorial we will create a custom module. We need to follow simple step to create module.

Follow below 4 step for create module.
1. Create the module folder at project path app/code/<vendor>/<module_name>
2. Create the etc/module.xml file in module
at app/code/<vendor>/<module_name>/etc/module.xml

PHP
<?php

declare(strict_types=1);

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'MageDad_Module',
    __DIR__
);

Above code in MageDad is <vendor> and Module is<module_name>

3. Create the registration.php file in module
at app/code/<vendor>/<module_name>/registration.php

PHP
<?php

declare(strict_types=1);

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'MageDad_Module',
    __DIR__
);


4. Run command php bin/magento setup:upgrade at root path in terminal to register module.

5. Verify app/etc/config.php file. There is module register like below screenshot.

How to Create a Custom Module in Magento 2?

You can see this commit of create simple module
You can follow official adobe document for create a module.

I hope this blog is useful to Create a Custom Module in Magento2. In case, I missed anything or need to add some more information, Don’t heisted to leave a comment in this blog, I’ll get back with some positive approach.

Keep loving ❤️ Keep inspiring 🤩 Keep liking 👍 No sharing 😂

15 Comments

  1. Its excellent as your other articles : D, thanks for putting up. “Too much sensibility creates unhappiness too much insensibility leads to crime.” by Charles Maurice de Talleyrand.

  2. F*ckin’ amazing things here. I am very happy to look your post. Thanks a lot and i’m looking forward to touch you. Will you kindly drop me a e-mail?

  3. I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

  4. Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  5. I am really inspired with your writing abilities as well as with the format on your weblog. Is this a paid subject or did you modify it yourself? Either way keep up the nice quality writing, it’s rare to see a nice blog like this one today..

  6. Nice post. I study one thing tougher on completely different blogs everyday. It would always be stimulating to read content material from different writers and follow somewhat one thing from their store. I’d choose to make use of some with the content material on my blog whether or not you don’t mind. Natually I’ll offer you a link in your net blog. Thanks for sharing.

  7. Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

Write A Comment