Wednesday, July 15, 2020
Home > Beginners of Magento 2 > Magento 2 Module Development – Simple Module

Magento 2 Module Development – Simple Module

Module Development

Magento 2 Module development or Magento 2 Hello World trends is increase rapidly while Magento release official version. That why I am writing about a topic that introduces how to create a simple Module. Before that you can see what is magento2?

As you know, the module is a directory that contains blocks, controllers, models, helper, etc – that are related to a specific business feature. The etc folder contains admin ACL, admin menu, configuration . In Magento 2, modules will be live in app/code directory of a Magento installation, with this format: app/code//. Now i am follow this steps to create a simple module which work on Magento 2 and display Hello World.

To create Hello World module, you need to complete the following high-level steps:

Best Practice Use PHP Storm

Step 1: Create the folder of Hello World module

Step 2: Create module

Step 3: Register the Created Module

Step 4: Enable the module

Step 1: Create Folder of HelloWorld

Name of the module is defined as “VendorName_ModuleName”. First part is name of the vendor and last part is name of the module: For example: Ketan_HelloWorld.

##### create file directory as

Step 2: Create Module

it is necessary to create etc folder and add the module.xml file

Contents would be:

Step 3 : Register the Created Module

Create Registration.php file

Contents would be:

Step 4: Enable the module

Before enable the Module make sure whether the Module is created or not. For that run the command from the Magento root directory as.

It Lists all the Disabled Modules

###### Ketan_HelloWorld

To enable the Module run the command as:

Spread the love

Leave a Reply

Your email address will not be published.