Magento 2 Skeleton Module

Published Thursday, January 16, 2020

You can usually find examples to copy in Magento's core files.

Much of this was copy/paste from the Magento_Widget module.

File List

  • Joki/Skeleton/composer.json
  • Joki/Skeleton/registration.php
  • Joki/Skeleton/etc/module.xml

composer.json [copy] [hide]

  1{
  2    "name": "joki/module-skeleton",
  3    "description": "N/A",
  4    "config": {
  5        "sort-packages": true
  6    },
  7    "require": {
  8        "php": "~7.1.3||~7.2.0",
  9        "magento/framework": "102.0.*",
 10        "magento/module-backend": "101.0.*",
 11        "magento/module-catalog": "103.0.*",
 12        "magento/module-cms": "103.0.*",
 13        "magento/module-store": "101.0.*",
 14        "magento/module-theme": "101.0.*",
 15        "magento/module-variable": "100.3.*"
 16    },
 17    "type": "magento2-module",
 18    "license": [
 19        "OSL-3.0",
 20        "AFL-3.0"
 21    ],
 22    "autoload": {
 23        "files": [
 24            "registration.php"
 25        ],
 26        "psr-4": {
 27            "Magento\\Widget\\": ""
 28        }
 29    },
 30    "version": "0.1.0"
 31}

registration.php [copy] [hide]

 
  1<?php
  2use \Magento\Framework\Component\ComponentRegistrar;
  3
  4ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Joki_Skeleton', __DIR__);
 

etc/module.xml [copy] [hide]

 
  1<?xml version="1.0"?>
  2<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  3    <module name="Joki_Skeleton" />
  4</config>