Magento 2 Module Creator is an online module creator tool which helps you to generate and download the basic code that you require all time for your custom module. You can generate a module based on the company name and the module name. This will save Magento developers time which helps in providing the estimation of custom module development.

To create your new module all you have to do is enter Namespace, Module Name and your Email. Then submit the form by clicking on the generate button. Your module will be downloaded as a zip archive file.

You can later start work by keeping, adding, removing, changing files according to your requirement.

This is what you get

Generate Your Module

Check appropriate checkbox if you need it in your custom module. By default module will be like shown in screenshots.

59 Comments
  • Jaimin Patel
    Posted at 06:28h, 09 August Reply

    It’s amazing module creator as per your needs and it saves developers time.

  • Mrudangi Vaghela
    Posted at 20:35h, 11 October Reply

    After installing module from here i am getting error in magento adminpanel. Can you send me video how it looks in magento backend?

    • Vicky
      Posted at 22:22h, 11 October Reply

      If the latest Magento version has a problem I need to fix that immediately.
      Can you please tell me which version of Magento 2 you are using?
      And What is the error?
      About the video, I am already showing screenshots on this page. It will show the same as screenshots in the admin panel also.

    • Chirag Chaudhari
      Posted at 07:01h, 15 October Reply

      Clear cache and run deploy command

  • Mrudangi Vaghela
    Posted at 19:00h, 12 October Reply

    Thanks for helping me. It worked fine.

    • Vicky
      Posted at 08:35h, 13 October Reply

       I am glad to help you with this.

  • umesh
    Posted at 11:19h, 13 November Reply

    i create a module that u mention but backed tutorial not here please help to create backed file for save,edit delete and add new data .

    • Vicky
      Posted at 04:33h, 21 November Reply

      Hello Umesh,

      I will make a tutorial about backend as soon as possible. In the mean time you can use the module creator to generate only backend CRUD and see the files and do some debugging to learn or check which code is for what.

  • Randy Orton
    Posted at 13:48h, 19 November Reply

    What I have to do if I only want to upload images into a specific folder ?

    • Vicky
      Posted at 04:02h, 21 November Reply

      My Module is Test_Testing
      In Save.php file which will be located at
      Admin – Controller/Adminhtml/Items/Save.php
      Frontend – Controller/Index/Save.php
      You will see this two lines and this
      1st line $mediaDirectory = $this->filesystem->getDirectoryRead($this->directoryList::MEDIA);
      2ed line $destinationPath = $mediaDirectory->getAbsolutePath(‘test/testing’);
      You can change as per your requirement.
      For example your folder is in pub/media then keep the first line and place your folder names in the second line like this
      let’s say you want to upload in a folder pub/media/new01/new02/new03/new04
      $destinationPath = $mediaDirectory->getAbsolutePath(‘new01/new02/new03/new04’);
      In short if we print $destinationPath variable we should have a real path like this
      E:/xampp/htdocs/magento/pub/media/new01/new02/new03/new04
      so if your folder is not in pub/media no problem you just need to get the real path like this somehow in the $destinationPath variable

      Then $imagePath = ‘test/testing’.$result[‘file’]; you need to change here also
      $imagePath = ‘new01/new02/new03/new04’.$result[‘file’];

      Done.

  • Harshil
    Posted at 14:03h, 05 December Reply

    Nice Article.
    Can you please add other articles like override the model, block, helper, controller . Also same using plugin.

  • Vijay
    Posted at 11:29h, 27 March Reply

    Very helpful module creator and save lot’s of my time

  • Rizwan
    Posted at 09:39h, 30 April Reply

    Hi Vicky,
    First of all Thank You for your great work.
    There is the problem with the submit form from the frontend.
    When i submit the form it’s display this “Invalid Form Key. Please refresh the page.”
    Our data not save from the frontend …
    How we can fix this problem ?

    Check this screenshot:
    https://www.screencast.com/t/1GKlxUuI
    I am using the Magento ver. 2.3.1
    How we can fix this ?

    Thank You!

    • Vicky
      Posted at 12:54h, 21 July Reply

      I have tested it in Magento 2.3.2 and it’s working. Yes, I haven’t tested it in Magento 2.3.1 but please let me know if you are still facing this issue.

  • anon
    Posted at 22:24h, 14 May Reply

    this is really useful. thank you sooooooooo much <3

  • Lavanya
    Posted at 08:02h, 22 May Reply

    Hi ,
    For multiple image upload ,How to do

  • Lavanya
    Posted at 10:47h, 23 May Reply

    I have created a db to store 5 different image in different column
    by using the module i uploaded successfully.
    My question is i have different name for each column of image

    while listing
    define that
    $data->getImage()

    while listing the details in database to frontend
    data is displaying
    for i am getting sam image in each column ??

    • Vicky
      Posted at 13:45h, 21 July Reply

      In $data->getImage(); “Image” is field name from our database table. Let me explain.
      I will try to keep it short but this is how we can upload and show multiple images while using this module.

      I am assuming we have added one more field for another image. If you don’t know how to do it please check Create a table using InstallSchema and UpgradeSchema in magento 2
      For me, the module name will be “VkyTest_Module” and added new field is “more_image.”

      In a phtml file where our form is we need to add new input type like below(for me it’s module.phtml)
      just copy past the div which has class “field image” and change input name to more_image

      Now let go to the controller Save.php
      add another if condition before this line $module = $this->_module->create(); like below

      if(isset($_FILES[‘more_image’][‘name’]) && $_FILES[‘more_image’][‘name’] != ”) {
      try{
      $uploaderFactory = $this->uploaderFactory->create([‘fileId’ => ‘more_image’]);
      $uploaderFactory->setAllowedExtensions([‘jpg’, ‘jpeg’, ‘gif’, ‘png’]);
      $imageAdapter = $this->adapterFactory->create();
      $uploaderFactory->addValidateCallback(‘custom_image_upload’,$imageAdapter,’validateUploadFile’);
      $uploaderFactory->setAllowRenameFiles(true);
      $uploaderFactory->setFilesDispersion(true);
      $mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
      $destinationPath = $mediaDirectory->getAbsolutePath(‘vkytest/module’);
      $result = $uploaderFactory->save($destinationPath);
      if (!$result) {
      throw new LocalizedException(
      __(‘File cannot be saved to path: $1’, $destinationPath)
      );
      }

      $imagePath = ‘vkytest/module’.$result[‘file’];
      $data[‘more_image’] = $imagePath;
      } catch (\Exception $e) {
      }
      }
      $module = $this->_module->create();


      To display

      in list.phtml file copy and paste td tag which has class “col image”
      and change $data->getImage() to $data->getMoreImage();

  • Dhiren Prajapati
    Posted at 11:02h, 26 June Reply

    Very helpful creator and save lot’s of my time. Easy to Customize and Install.

  • Ajay Sikarwar
    Posted at 12:12h, 01 July Reply

    I’m trying to download module but the generate module button is not working…!

    • Vicky
      Posted at 12:33h, 21 July Reply

      It’s working. Can you please let me know if you are still not able to download the module?

  • Shan
    Posted at 17:47h, 21 July Reply

    “Blocked loading mixed active content…”

    Generate form not worked. In debug tool I can see above error message.

    • Vicky
      Posted at 13:38h, 22 July Reply

      For me, Generate button is working(using Chrome, Firefox, even using mobile) if I try it here. I am able to download the zip file for a module. Can you please try it on chrome browser? I will look deep into it if many people face the same problem.

  • ashok
    Posted at 07:22h, 03 September Reply

    its a very usefull

  • Ashna
    Posted at 06:42h, 28 October Reply

    Generate module is not workng

    • Vicky
      Posted at 14:42h, 28 October Reply

      Sorry for the issue and thank you for informing me about that. I didn’t know that it wasn’t working. I have made some changes Can you please check/test now? It should be working. Let me know.

  • gowtham
    Posted at 10:15h, 26 December Reply

    Module not downloading the file,

    • Vicky
      Posted at 16:40h, 28 December Reply

      Thanks for informing. Please try now and let me know

  • Monisha Gaja
    Posted at 10:17h, 26 December Reply

    Unable to downloading ,Can you please resolve the issues, I am waiting for you response. by Monisha.

    • Vicky
      Posted at 16:39h, 28 December Reply

      Please try now and let me know.

  • Chirag
    Posted at 16:15h, 28 January Reply

    Hello. Nice module. FIrst of all thank you very much for this help. One suggetion : Can you make this with AJAX functionality? If yes than it will help me a lot. Thank you,

  • Nimitt
    Posted at 09:12h, 12 March Reply

    Generate module doesn’t work sometimes

    • Vicky
      Posted at 08:45h, 24 March Reply

      Please try now and let me know.
      Thank you for letting me know about the problem.
      Sorry I wasn’t aware of this. It was nothing just my disk quota was exceeded.

      • Nimitt ajmera
        Posted at 12:39h, 29 April Reply

        This works perfectly fine now, you’re doing great Vicky

  • Kanda
    Posted at 09:01h, 19 March Reply

    error when generate module

    • Vicky
      Posted at 08:44h, 24 March Reply

      Please try now and let me know.
      Thank you for letting me know about the problem.
      Sorry I wasn’t aware of this. It was nothing just my disk quota was exceeded.

  • Thomas
    Posted at 07:57h, 23 March Reply

    Hello! Would be nice to test this module generator. However, nothing happens when I hit “Generate” – button. Is this project still active?

    • Vicky
      Posted at 08:41h, 24 March Reply

      Please try now and let me know.
      Thank you for letting me know about the problem.
      Sorry I wasn’t aware of this. It was nothing just my disk quota was exceeded.

  • Hansraj
    Posted at 00:39h, 24 March Reply

    WE ARE NOT ABLE TO CREATE NEW MODULE FORM IT. WE ARE GETTING ERROR

    • Vicky
      Posted at 08:39h, 24 March Reply

      Please try now and let me know.
      Thank you for letting me know about the problem.
      Sorry I wasn’t aware of this. It was nothing just my disk quota was exceeded.

  • ajay singh
    Posted at 19:29h, 26 March Reply

    hi i have checked 2,5,6,7 checkbox from above and created a module…frontend with database which insert from frontend and show listing in frontend.But on submittting form data does net get saved in the table..

    • Vicky
      Posted at 21:34h, 26 March Reply

      Hello Ajay, I have checked/tested using the same options and it’s working I can see records in my database table.
      Are you sure you were using 2,5,6,7?
      2 – Need Frontend
      5 – Need Database Table
      6 – Need to insert data from frontend
      7 – Need to display data at frontend (List page with pagination and View page)
      These checkboxes? And let me know what did you use for “Company Name” and “Module Name”.

      If you are not seeing data on the frontend list and view page using this checkbox options then check the status field in the database table. It will have a default value “0” which might lead to not displaying the data on the list and view page. To solve that you need to do 2 small changes.
      1. – app/code/[CompanyName]/[ModuleName]/Block/[ModuleName]listData.php remove this line – $collection->addFieldToFilter(‘status’,’1′);
      2. – app/code/[CompanyName]/[ModuleName]/Block/[ModuleName]View.php change
      “if($singleData->get[ModuleName]Id() || $singleData[‘[modulename]_id’] && $singleData->getStatus() == 1){”
      to
      “if($singleData->get[ModuleName]Id() || $singleData[‘[modulename]_id’]){”
      Now you will be able to see the data in list and view page without having admin CRUD.

  • ajay
    Posted at 19:31h, 26 March Reply

    form data not saving in table

    • Vicky
      Posted at 06:49h, 15 September Reply

      Can you please let me know in which Magento version you are facing this issue so that I can check? Or Please try once more because I have tested in Magento 2.4.3 and all things working well.

  • ajay
    Posted at 10:33h, 27 March Reply

    after clicking submit nothing happens.Page redirects to same url of form.No data is inserted in table.So clearly frontend will show blank.

  • ajay
    Posted at 12:21h, 27 March Reply

    it worked finally with the deploy command..thanx for this creator..its great

  • Bruno
    Posted at 16:00h, 17 July Reply

    Hi
    Not working?
    Regards

    • Vicky
      Posted at 08:47h, 21 July Reply

      Please try now.

  • Ricardo
    Posted at 00:12h, 18 July Reply

    Not working.
    Possible to make it work?
    Regards

    • Vicky
      Posted at 08:48h, 21 July Reply

      Please try now.

      • Ricardo
        Posted at 09:08h, 25 July Reply

        Thank you for the fix.
        Awesome job Vicky.

  • Maan
    Posted at 11:56h, 23 July Reply

    Hello Vicky,

    Can you Please check your module creator not working now.

    Regards

    • Vicky
      Posted at 06:47h, 15 September Reply

      Hello Maan, Sorry for the very late reply but I have tested in Magento 2.4.3 and all things working.

  • Vadivukarasi
    Posted at 11:00h, 13 August Reply

    You are Rocking, i never find such tool. Thank you so much for your awesome tool.

  • bhavin
    Posted at 09:20h, 14 August Reply

    Hii

    -I created a module..
    -Vendor name:- Elatebrain
    -Module name:- ContactInfo
    but can you please tell me what is the fronted link for listing page of grid.
    -I need this page link. https://prnt.sc/1oheu2x
    can you tell what is the link of this page
    Thank you.

    • Vicky
      Posted at 06:43h, 15 September Reply

      Hello bhavin, Link for the listing page is “www.yoursite.com/contactInfo/index/list”

  • Hamza Mughal
    Posted at 13:37h, 18 August Reply

    Vicky, your other modules are not opening in magento 2 section kindly please check it

    • Vicky
      Posted at 06:45h, 15 September Reply

      Hello Hamza, Sorry I am busy with some work but recently I have tested in Magento 2.4.3 and all things working. Can you please let me know in which Magento version you are facing this issue?

Post A Comment