Create a New Module Magento2

In this article, we are going to describe create a New Module Magento2 .what is the basic thing you need to know when creating a new module in magento2.

So we are using the sample module MageChallenge_SetupData to create a new module.

Create module.xml file

app/code/MageChallenge/SetupData/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="MageChallenge_SetupData" setup_version="1.0.0">
    </module>
</config>

Create registration.php file

app/code/MageChallenge/SetupData/registration.php

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

Yes, we almost create basic files that need to add. Now it is time to run the setup. Open your terminal and run the following command.

php bin/magento setup:upgrade

We are finish creating our module. you can check your module in app/etc/config.php

‘MageChallenge_SetupData’ => 1,

Latest posts by Chathura Janaka Liyanage (see all)

56 thoughts on “Create a New Module Magento2

  1. A lot of thanks for all your efforts on this site. Gloria enjoys doing investigation and it’s easy to understand why. Almost all know all concerning the dynamic means you deliver great information on the web blog and as well encourage contribution from other people on that concept plus our daughter is actually being taught a lot. Have fun with the remaining portion of the new year. You’re the one conducting a glorious job.

  2. Thanks for your own work on this website. My mum take interest in setting aside time for research and it is simple to grasp why. We notice all relating to the powerful way you provide very helpful tips via your website and therefore strongly encourage response from visitors on this subject matter while our own simple princess is undoubtedly studying so much. Take pleasure in the rest of the year. Your performing a tremendous job.

  3. I wanted to post you that tiny remark to say thanks a lot over again just for the pleasant solutions you have featured in this case. It was really shockingly open-handed with you to grant publicly just what many of us might have offered for an ebook to generate some dough for themselves, mostly now that you might have tried it in case you desired. These secrets as well served to be a good way to fully grasp that other people online have the identical fervor much like my personal own to know the truth more regarding this matter. I am sure there are numerous more pleasant periods in the future for many who read your site.

  4. I’m just commenting to let you be aware of of the fabulous discovery my cousin’s daughter experienced going through your site. She even learned lots of issues, most notably how it is like to have a very effective giving mindset to have many others just gain knowledge of chosen grueling matters. You really did more than our desires. Many thanks for distributing the important, healthy, educational and as well as easy thoughts on the topic to Gloria.

  5. I intended to compose you a bit of note in order to give many thanks again about the awesome basics you’ve contributed above. It’s generous of people like you giving easily all a few individuals could have advertised as an e-book in making some bucks for their own end, and in particular considering that you could have done it if you considered necessary. The basics additionally acted as a easy way to be aware that many people have a similar desire just as mine to figure out a good deal more around this condition. Certainly there are a lot more enjoyable instances ahead for folks who check out your blog.

  6. I am only writing to make you understand what a superb experience our princess undergone viewing yuor web blog. She picked up such a lot of things, with the inclusion of what it is like to possess an ideal teaching style to make the others without hassle thoroughly grasp specified tricky topics. You undoubtedly surpassed visitors’ expected results. Thanks for showing those valuable, trustworthy, revealing not to mention unique tips on your topic to Sandra.

Leave a Reply