How to register an extension in magento 2

Nơw, we will try to register an extension in magento 2. We will create some files:

magento2-rewardcredit

The first file is /app/code/Mageoneplus/Rewardcredit/etc/module.xml. We will create a magento module named Rewardcredit in local Mageoneplus version 1.0.0:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Mageoneplus_Rewardcredit" setup_version="1.0.0"/>
</config>

The second file is app/code/Mageoneplus/Rewardcredit/registration.php

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

And we will run comand php in the folder root of the website magento to upgrade:

php bin/magento setup:upgrade

You will see it like:

setup_upgrade

Now, please login to admin page -> Stores -> Settings -> Configuration -> Advanced -> Advanced -> Disable Modules Output, you will see the Mageoneplus_Rewardcredit:

advane-configuration

 

Here is full code to register the Reward Credit extension in magento 2.

Thank you very much for reading!

Add Comment

Required fields are marked *. Your email address will not be published.