Magento 2 Module

How to create a new module in Magento 2

Hide/Show description

Hi Everybody, I am Cuong, Welcome to my Magento 2 Tutorial video series. #magento2tutorial Today, I am going to show everybody a best practice, How to create a new module in Magento 2. A sample module in magento 2. A basic module in Magento 2. Create a simple module in magento 2 If you are a beginner with Magento 2, you are learning how to create a custom module in Magento 2, so in this video I will show you, how I can help you complete your task. In this exercise, I am going to create a new module named PHPCuong_BannerSlider To complete this best practice you need to complete the following high-level steps: 1. Create the namespace named PHPCuong in the path app\code. 2. Create the module named BannerSlider in the path app\code\PHPCuong. 3. Create the file named registration.php in the path app\code\PHPCuong\BannerSlider \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'PHPCuong_BannerSlider', __DIR__ ); 4. Create the file named module.xml in the path app\code\PHPCuong\BannerSlider\etc 5. Install the new module Run the command line: - php bin/magento setup:upgrade --keep-generated 6. Check the new module is working Run the command line: - php bin/magento module:status Or you can go to the database, get a look at the table named setup_module You can disable the new module by running the command line: php bin/magento module:disable PHPCuong_BannerSlider Thank you for your watching. If you have any questions about this exercise please feel free to leave a comment below. Don't forget to like, comment, share and subscribe to my channel for getting the latest videos. Please do not hesitate to contact me if you need me to join your Magento project. My rate is $25/hour in Magento 1 and $30/hour in Magento 2. Get the source codes of this tutorial on the github